зеркало из https://github.com/mozilla/pjs.git
Rename nsIFrame::GetPresContext to nsIFrame::PresContext. Bug 376042, patch by
Taras Glek <tglek@mozilla.com>, rs=roc.
This commit is contained in:
Родитель
fbe54ac96b
Коммит
d9f302946b
|
@ -1480,7 +1480,7 @@ nsEventStateManager::FireContextClick()
|
|||
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
|
||||
|
|
|
@ -817,7 +817,7 @@ nsAbsoluteItems::nsAbsoluteItems(nsIFrame* aContainingBlock)
|
|||
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);
|
||||
|
@ -9606,7 +9606,7 @@ UpdateViewsForTree(nsIFrame* aFrame, nsIViewManager* aViewManager,
|
|||
nsIView* view = aFrame->GetView();
|
||||
if (view) {
|
||||
if (aChange & nsChangeHint_SyncFrameView) {
|
||||
nsContainerFrame::SyncFrameViewProperties(aFrame->GetPresContext(),
|
||||
nsContainerFrame::SyncFrameViewProperties(aFrame->PresContext(),
|
||||
aFrame, nsnull, view);
|
||||
}
|
||||
}
|
||||
|
@ -9748,7 +9748,7 @@ InvalidateCanvasIfNeeded(nsIFrame* aFrame)
|
|||
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();
|
||||
|
|
|
@ -2554,7 +2554,7 @@ FindCanvasBackground(nsIFrame* aForFrame,
|
|||
// 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();
|
||||
|
|
|
@ -68,7 +68,7 @@ nsDisplayListBuilder::nsDisplayListBuilder(nsIFrame* aReferenceFrame,
|
|||
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);
|
||||
|
@ -97,7 +97,7 @@ DestroyRectFunc(void* aFrame,
|
|||
}
|
||||
|
||||
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)) {
|
||||
|
@ -127,7 +127,7 @@ static void MarkOutOfFlowFrameForDisplay(nsIFrame* aDirtyFrame, nsIFrame* aFrame
|
|||
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)) {
|
||||
|
@ -154,7 +154,7 @@ nsDisplayListBuilder::GetCaret() {
|
|||
if (!frame) {
|
||||
return nsnull;
|
||||
}
|
||||
nsIPresShell* shell = frame->GetPresContext()->PresShell();
|
||||
nsIPresShell* shell = frame->PresContext()->PresShell();
|
||||
nsCOMPtr<nsICaret> caret;
|
||||
shell->GetCaret(getter_AddRefs(caret));
|
||||
|
||||
|
@ -167,7 +167,7 @@ nsDisplayListBuilder::EnterPresShell(nsIFrame* aReferenceFrame,
|
|||
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();
|
||||
|
@ -502,7 +502,7 @@ nsDisplayBackground::IsOpaque(nsDisplayListBuilder* aBuilder) {
|
|||
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) ||
|
||||
|
@ -520,7 +520,7 @@ nsDisplayBackground::IsUniform(nsDisplayListBuilder* aBuilder) {
|
|||
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) &&
|
||||
|
@ -537,7 +537,7 @@ nsDisplayBackground::IsVaryingRelativeToFrame(nsDisplayListBuilder* aBuilder,
|
|||
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())
|
||||
|
@ -560,7 +560,7 @@ 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(),
|
||||
|
@ -577,7 +577,7 @@ 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(),
|
||||
|
@ -639,7 +639,7 @@ 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());
|
||||
|
|
|
@ -852,8 +852,8 @@ public:
|
|||
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")
|
||||
|
|
|
@ -400,8 +400,8 @@ nsLayoutUtils::DoCompareTreePosition(nsIFrame* aFrame1,
|
|||
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;
|
||||
}
|
||||
|
@ -619,7 +619,7 @@ nsLayoutUtils::GetEventCoordinatesRelativeTo(nsEvent* aEvent, nsIFrame* aFrame)
|
|||
if (!rootView)
|
||||
return nsPoint(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE);
|
||||
|
||||
nsPoint widgetToView = TranslateWidgetToView(rootFrame->GetPresContext(),
|
||||
nsPoint widgetToView = TranslateWidgetToView(rootFrame->PresContext(),
|
||||
GUIEvent->widget, GUIEvent->refPoint,
|
||||
rootView);
|
||||
|
||||
|
@ -648,7 +648,7 @@ nsLayoutUtils::GetEventCoordinatesForNearestView(nsEvent* aEvent,
|
|||
if (aView)
|
||||
*aView = frameView;
|
||||
|
||||
return TranslateWidgetToView(aFrame->GetPresContext(), GUIEvent->widget,
|
||||
return TranslateWidgetToView(aFrame->PresContext(), GUIEvent->widget,
|
||||
GUIEvent->refPoint, frameView);
|
||||
}
|
||||
|
||||
|
@ -702,7 +702,7 @@ PRBool
|
|||
nsLayoutUtils::IsInitialContainingBlock(nsIFrame* aFrame)
|
||||
{
|
||||
return aFrame ==
|
||||
aFrame->GetPresContext()->PresShell()->FrameConstructor()->GetInitialContainingBlock();
|
||||
aFrame->PresContext()->PresShell()->FrameConstructor()->GetInitialContainingBlock();
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
@ -1072,7 +1072,7 @@ 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);
|
||||
|
@ -1126,8 +1126,8 @@ nsLayoutUtils::GetClosestCommonAncestorViaPlaceholders(nsIFrame* aFrame1,
|
|||
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;
|
||||
}
|
||||
|
@ -1201,7 +1201,7 @@ nsLayoutUtils::IsViewportScrollbarFrame(nsIFrame* aFrame)
|
|||
return PR_FALSE;
|
||||
|
||||
nsIFrame* rootScrollFrame =
|
||||
aFrame->GetPresContext()->PresShell()->GetRootScrollFrame();
|
||||
aFrame->PresContext()->PresShell()->GetRootScrollFrame();
|
||||
if (!rootScrollFrame)
|
||||
return PR_FALSE;
|
||||
|
||||
|
@ -1398,7 +1398,7 @@ nsLayoutUtils::IntrinsicForContainer(nsIRenderingContext *aRenderingContext,
|
|||
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);
|
||||
|
@ -1713,7 +1713,7 @@ nsLayoutUtils::DrawString(const nsIFrame* aFrame,
|
|||
{
|
||||
#ifdef IBMBIDI
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
nsPresContext* presContext = aFrame->GetPresContext();
|
||||
nsPresContext* presContext = aFrame->PresContext();
|
||||
if (presContext->BidiEnabled()) {
|
||||
nsBidiPresUtils* bidiUtils = presContext->GetBidiUtils();
|
||||
|
||||
|
@ -1748,7 +1748,7 @@ nsLayoutUtils::GetStringWidth(const nsIFrame* aFrame,
|
|||
// 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();
|
||||
|
||||
|
@ -1875,7 +1875,7 @@ nsLayoutUtils::GetClosestLayer(nsIFrame* aFrame)
|
|||
}
|
||||
if (layer)
|
||||
return layer;
|
||||
return aFrame->GetPresContext()->PresShell()->FrameManager()->GetRootFrame();
|
||||
return aFrame->PresContext()->PresShell()->FrameManager()->GetRootFrame();
|
||||
}
|
||||
|
||||
/* static */ nsresult
|
||||
|
|
|
@ -904,7 +904,7 @@ nsPresContext::RootPresContext()
|
|||
if (rootFrame) {
|
||||
nsIFrame* f = nsLayoutUtils::GetCrossDocParentFrame(rootFrame);
|
||||
if (f) {
|
||||
pc = f->GetPresContext();
|
||||
pc = f->PresContext();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5574,7 +5574,7 @@ PresShell::HandleEvent(nsIView *aView,
|
|||
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?");
|
||||
|
@ -5602,7 +5602,7 @@ PresShell::HandleEvent(nsIView *aView,
|
|||
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).
|
||||
|
|
|
@ -137,7 +137,7 @@ void nsDisplayButtonBorderBackground::Paint(nsDisplayListBuilder* aBuilder,
|
|||
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
|
||||
|
@ -148,7 +148,7 @@ 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)) {
|
||||
|
|
|
@ -328,7 +328,7 @@ NS_IMETHODIMP nsComboboxControlFrame::GetAccessible(nsIAccessible** aAccessible)
|
|||
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -365,7 +365,7 @@ nsComboboxControlFrame::SetFocus(PRBool aOn, PRBool aRepaint)
|
|||
// 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);
|
||||
}
|
||||
|
@ -394,7 +394,7 @@ nsComboboxControlFrame::ShowPopup(PRBool 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);
|
||||
}
|
||||
|
@ -513,7 +513,7 @@ nsComboboxControlFrame::AbsolutelyPositionDropDown()
|
|||
// 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();
|
||||
|
||||
|
@ -637,7 +637,7 @@ nsComboboxControlFrame::Reflow(nsPresContext* aPresContext,
|
|||
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()) {
|
||||
|
@ -711,9 +711,9 @@ nsComboboxControlFrame::ShowDropDown(PRBool aDoDropDown)
|
|||
if (mListControlFrame) {
|
||||
mListControlFrame->SyncViewWithFrame();
|
||||
}
|
||||
ToggleList(GetPresContext());
|
||||
ToggleList(PresContext());
|
||||
} else if (mDroppedDown && !aDoDropDown) {
|
||||
ToggleList(GetPresContext());
|
||||
ToggleList(PresContext());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -791,7 +791,7 @@ nsComboboxControlFrame::HandleRedisplayTextEvent()
|
|||
// 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())
|
||||
|
@ -804,7 +804,7 @@ nsComboboxControlFrame::HandleRedisplayTextEvent()
|
|||
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;
|
||||
|
@ -1102,7 +1102,7 @@ nsComboboxControlFrame::CreateFrameFor(nsIContent* aContent)
|
|||
}
|
||||
|
||||
// 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
|
||||
|
@ -1250,7 +1250,7 @@ nsComboboxControlFrame::Rollup()
|
|||
void
|
||||
nsComboboxControlFrame::RollupFromList()
|
||||
{
|
||||
nsPresContext* aPresContext = GetPresContext();
|
||||
nsPresContext* aPresContext = PresContext();
|
||||
|
||||
ShowList(aPresContext, PR_FALSE);
|
||||
mListControlFrame->CaptureMouseEvents(PR_FALSE);
|
||||
|
@ -1311,7 +1311,7 @@ nsComboboxControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
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)) &&
|
||||
|
@ -1410,7 +1410,7 @@ 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)))) {
|
||||
|
|
|
@ -262,7 +262,7 @@ nsFieldSetFrame::PaintBorderBackground(nsIRenderingContext& aRenderingContext,
|
|||
|
||||
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.
|
||||
|
@ -700,7 +700,7 @@ nsFieldSetFrame::RemoveFrame(nsIAtom* aListName,
|
|||
mFrames.DestroyFrame(mLegendFrame);
|
||||
mLegendFrame = nsnull;
|
||||
AddStateBits(NS_FRAME_IS_DIRTY);
|
||||
GetPresContext()->PresShell()->
|
||||
PresContext()->PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eTreeChange);
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -730,7 +730,7 @@ nsFieldSetFrame::MaybeSetLegend(nsIFrame* aFrameList, nsIAtom* aListName)
|
|||
mLegendFrame->SetNextSibling(mContentFrame);
|
||||
mFrames.SetFrames(mLegendFrame);
|
||||
AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
GetPresContext()->PresShell()->
|
||||
PresContext()->PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eTreeChange);
|
||||
}
|
||||
return aFrameList;
|
||||
|
@ -739,7 +739,7 @@ nsFieldSetFrame::MaybeSetLegend(nsIFrame* aFrameList, nsIAtom* aListName)
|
|||
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);
|
||||
|
|
|
@ -234,7 +234,7 @@ nsFileControlFrame::SetFocus(PRBool aOn, PRBool aRepaint)
|
|||
if (mTextFrame) {
|
||||
nsIContent* content = mTextFrame->GetContent();
|
||||
if (content) {
|
||||
content->SetFocus(GetPresContext());
|
||||
content->SetFocus(PresContext());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -117,7 +117,7 @@ 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!");
|
||||
|
||||
|
|
|
@ -140,7 +140,7 @@ nsGfxButtonControlFrame::CreateFrameFor(nsIContent* aContent)
|
|||
nsIFrame * parentFrame = mFrames.FirstChild();
|
||||
nsStyleContext* styleContext = parentFrame->GetStyleContext();
|
||||
|
||||
nsPresContext* presContext = GetPresContext();
|
||||
nsPresContext* presContext = PresContext();
|
||||
nsRefPtr<nsStyleContext> textStyleContext;
|
||||
textStyleContext = presContext->StyleSet()->
|
||||
ResolveStyleForNonElement(styleContext);
|
||||
|
|
|
@ -264,10 +264,10 @@ nsGfxCheckboxControlFrame::PaintCheckBoxFromStyle(
|
|||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -150,7 +150,7 @@ nsGfxRadioControlFrame::PaintRadioButtonFromStyle(
|
|||
// 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);
|
||||
|
|
|
@ -100,7 +100,7 @@ nsHTMLButtonControlFrame::Init(
|
|||
{
|
||||
nsresult rv = nsHTMLContainerFrame::Init(aContent, aParent, aPrevInFlow);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
mRenderer.SetFrame(this, GetPresContext());
|
||||
mRenderer.SetFrame(this, PresContext());
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
|
|
@ -142,7 +142,7 @@ nsIsIndexFrame::UpdatePromptLabel()
|
|||
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);
|
||||
|
@ -303,7 +303,7 @@ nsIsIndexFrame::KeyPress(nsIDOMEvent* aEvent)
|
|||
keyEvent->GetCharCode(&code);
|
||||
}
|
||||
if (nsIDOMKeyEvent::DOM_VK_RETURN == code) {
|
||||
OnSubmit(GetPresContext());
|
||||
OnSubmit(PresContext());
|
||||
aEvent->PreventDefault(); // XXX Needed?
|
||||
}
|
||||
}
|
||||
|
|
|
@ -260,7 +260,7 @@ void nsListControlFrame::PaintFocus(nsIRenderingContext& aRC, nsPoint aPt)
|
|||
focusedIndex = mEndSelectionIndex;
|
||||
}
|
||||
|
||||
nsPresContext* presContext = GetPresContext();
|
||||
nsPresContext* presContext = PresContext();
|
||||
if (!GetScrollableView()) return;
|
||||
|
||||
nsIPresShell *presShell = presContext->GetPresShell();
|
||||
|
@ -405,7 +405,7 @@ NS_IMETHODIMP nsListControlFrame::GetAccessible(nsIAccessible** aAccessible)
|
|||
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -1658,7 +1658,7 @@ nsListControlFrame::FireOnChange()
|
|||
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);
|
||||
}
|
||||
|
@ -1896,7 +1896,7 @@ nsListControlFrame::CalcFallbackRowHeight(PRInt32 aNumOptions)
|
|||
// 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();
|
||||
|
@ -1914,7 +1914,7 @@ nsListControlFrame::CalcFallbackRowHeight(PRInt32 aNumOptions)
|
|||
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) {
|
||||
|
@ -1943,7 +1943,7 @@ nsListControlFrame::CalcIntrinsicHeight(nscoord aHeightOfARow,
|
|||
// [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) {
|
||||
|
@ -2166,7 +2166,7 @@ nsListControlFrame::GetIndexFromDOMEvent(nsIDOMEvent* aMouseEvent,
|
|||
}
|
||||
|
||||
nsCOMPtr<nsIContent> content;
|
||||
GetPresContext()->EventStateManager()->
|
||||
PresContext()->EventStateManager()->
|
||||
GetEventTargetContent(nsnull, getter_AddRefs(content));
|
||||
|
||||
nsCOMPtr<nsIContent> optionContent = GetOptionFromContent(content);
|
||||
|
@ -2175,7 +2175,7 @@ nsListControlFrame::GetIndexFromDOMEvent(nsIDOMEvent* aMouseEvent,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsIPresShell *presShell = GetPresContext()->PresShell();
|
||||
nsIPresShell *presShell = PresContext()->PresShell();
|
||||
PRInt32 numOptions = GetNumberOfOptions();
|
||||
if (numOptions < 1)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -2368,7 +2368,7 @@ nsListControlFrame::ScrollToFrame(nsIContent* aOptElement)
|
|||
}
|
||||
|
||||
// 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);
|
||||
|
@ -2807,7 +2807,7 @@ nsListControlFrame::KeyPress(nsIDOMEvent* aKeyEvent)
|
|||
// 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);
|
||||
}
|
||||
|
||||
|
|
|
@ -1087,7 +1087,7 @@ nsTextControlFrame::PreDestroy()
|
|||
|
||||
// Clean up the controller
|
||||
|
||||
if (!SuppressEventHandlers(GetPresContext()))
|
||||
if (!SuppressEventHandlers(PresContext()))
|
||||
{
|
||||
nsCOMPtr<nsIControllers> controllers;
|
||||
nsCOMPtr<nsIDOMNSHTMLInputElement> inputElement = do_QueryInterface(mContent);
|
||||
|
@ -1282,7 +1282,7 @@ nsTextControlFrame::CalcIntrinsicSize(nsIRenderingContext* aRenderingContext,
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
aRenderingContext->SetFont(fontMet);
|
||||
|
||||
nsPresContext* presContext = GetPresContext();
|
||||
nsPresContext* presContext = PresContext();
|
||||
lineHeight = nsHTMLReflowState::CalcLineHeight(presContext,
|
||||
aRenderingContext,
|
||||
this);
|
||||
|
@ -1341,7 +1341,7 @@ nsTextControlFrame::CalcIntrinsicSize(nsIRenderingContext* aRenderingContext,
|
|||
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();
|
||||
|
@ -1364,7 +1364,7 @@ nsTextControlFrame::CreateFrameFor(nsIContent* aContent)
|
|||
mCreateFrameForCalled = PR_TRUE;
|
||||
#endif
|
||||
|
||||
nsPresContext *presContext = GetPresContext();
|
||||
nsPresContext *presContext = PresContext();
|
||||
nsIPresShell *shell = presContext->GetPresShell();
|
||||
if (!shell)
|
||||
return nsnull;
|
||||
|
@ -1651,7 +1651,7 @@ nsTextControlFrame::CreateAnonymousContent(nsTArray<nsIContent*>& aElements)
|
|||
{
|
||||
mState |= NS_FRAME_INDEPENDENT_SELECTION;
|
||||
|
||||
nsIPresShell* shell = GetPresContext()->GetPresShell();
|
||||
nsIPresShell* shell = PresContext()->GetPresShell();
|
||||
if (!shell)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
|
@ -1825,7 +1825,7 @@ void nsTextControlFrame::SetFocus(PRBool aOn, PRBool aRepaint)
|
|||
// 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
|
||||
|
@ -1835,7 +1835,7 @@ void nsTextControlFrame::SetFocus(PRBool aOn, PRBool aRepaint)
|
|||
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;
|
||||
|
@ -2348,14 +2348,14 @@ nsTextControlFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
|||
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);
|
||||
|
@ -2368,7 +2368,7 @@ nsTextControlFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
|||
{ // set disabled
|
||||
flags |= nsIPlaintextEditor::eEditorDisabledMask;
|
||||
mSelCon->SetDisplaySelection(nsISelectionController::SELECTION_OFF);
|
||||
if (IsFocusedContent(GetPresContext(), mContent))
|
||||
if (IsFocusedContent(PresContext(), mContent))
|
||||
mSelCon->SetCaretEnabled(PR_FALSE);
|
||||
}
|
||||
else
|
||||
|
@ -2467,7 +2467,7 @@ nsTextControlFrame::FireOnInput()
|
|||
|
||||
// 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);
|
||||
}
|
||||
|
||||
|
@ -2488,7 +2488,7 @@ nsTextControlFrame::CheckFireOnChange()
|
|||
// 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;
|
||||
|
@ -2740,7 +2740,7 @@ nsTextControlFrame::SetInitialChildList(nsIAtom* aListName,
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ nsAbsoluteContainingBlock::AppendFrames(nsIFrame* aDelegatingFrame,
|
|||
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);
|
||||
}
|
||||
|
||||
|
@ -113,7 +113,7 @@ nsAbsoluteContainingBlock::InsertFrames(nsIFrame* aDelegatingFrame,
|
|||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ nsAreaFrame::RegUnregAccessKey(PRBool aDoReg)
|
|||
|
||||
// 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();
|
||||
|
|
|
@ -307,7 +307,7 @@ nsBlockFrame::Destroy()
|
|||
|
||||
mFloats.DestroyFrames();
|
||||
|
||||
nsPresContext* presContext = GetPresContext();
|
||||
nsPresContext* presContext = PresContext();
|
||||
|
||||
nsLineBox::DeleteLineList(presContext, mLines);
|
||||
|
||||
|
@ -603,7 +603,7 @@ static void ReparentFrame(nsIFrame* aFrame, nsIFrame* aOldParent,
|
|||
|
||||
// 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);
|
||||
}
|
||||
|
||||
|
@ -785,7 +785,7 @@ CalculateContainingBlockSizeForAbsolutes(const nsHTMLReflowState& aReflowState,
|
|||
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
|
||||
|
@ -2423,7 +2423,7 @@ nsBlockFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
|||
return rv;
|
||||
}
|
||||
if (nsGkAtoms::start == aAttribute) {
|
||||
nsPresContext* presContext = GetPresContext();
|
||||
nsPresContext* presContext = PresContext();
|
||||
|
||||
// XXX Not sure if this is necessary anymore
|
||||
RenumberLists(presContext);
|
||||
|
@ -2443,7 +2443,7 @@ nsBlockFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
|||
// 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);
|
||||
|
||||
|
@ -4457,7 +4457,7 @@ nsBlockFrame::SetOverflowLines(nsLineList* aOverflowLines)
|
|||
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);
|
||||
|
@ -4564,7 +4564,7 @@ nsBlockFrame::AppendFrames(nsIAtom* aListName,
|
|||
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;
|
||||
|
@ -4612,7 +4612,7 @@ nsBlockFrame::InsertFrames(nsIAtom* aListName,
|
|||
#endif // IBMBIDI
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN); // XXX sufficient?
|
||||
GetPresContext()->PresShell()->
|
||||
PresContext()->PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eTreeChange);
|
||||
}
|
||||
return rv;
|
||||
|
@ -4651,7 +4651,7 @@ nsBlockFrame::AddFrames(nsIFrame* aFrameList,
|
|||
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();
|
||||
|
@ -4762,7 +4762,7 @@ nsBlockFrame::RemoveFloat(nsIFrame* aFloat) {
|
|||
|
||||
// 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);
|
||||
|
@ -4887,7 +4887,7 @@ nsBlockFrame::RemoveFrame(nsIAtom* aListName,
|
|||
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN); // XXX sufficient?
|
||||
GetPresContext()->PresShell()->
|
||||
PresContext()->PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eTreeChange);
|
||||
}
|
||||
return rv;
|
||||
|
@ -4971,7 +4971,7 @@ nsBlockFrame::DoRemoveFrame(nsIFrame* aDeletedFrame, PRBool aDestroyFrames,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsPresContext* presContext = GetPresContext();
|
||||
nsPresContext* presContext = PresContext();
|
||||
nsIPresShell* presShell = presContext->PresShell();
|
||||
|
||||
PRBool isPlaceholder = nsGkAtoms::placeholderFrame == aDeletedFrame->GetType();
|
||||
|
@ -5688,7 +5688,7 @@ NS_IMETHODIMP nsBlockFrame::GetAccessible(nsIAccessible** aAccessible)
|
|||
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
|
||||
|
@ -5928,7 +5928,7 @@ nsBlockFrame::SetInitialChildList(nsIAtom* aListName,
|
|||
mFloats.SetFrames(aChildList);
|
||||
}
|
||||
else {
|
||||
nsPresContext* presContext = GetPresContext();
|
||||
nsPresContext* presContext = PresContext();
|
||||
|
||||
// Lookup up the two pseudo style contexts
|
||||
if (nsnull == GetPrevInFlow()) {
|
||||
|
|
|
@ -112,7 +112,7 @@ nsBlockReflowContext::ComputeCollapsedTopMargin(const nsHTMLReflowState& aRS,
|
|||
// 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)) {
|
||||
|
|
|
@ -361,7 +361,7 @@ nsBulletFrame::PaintBullet(nsIRenderingContext& aRenderingContext, nsPoint aPt,
|
|||
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"...
|
||||
|
@ -382,7 +382,7 @@ nsBulletFrame::PaintBullet(nsIRenderingContext& aRenderingContext, nsPoint aPt,
|
|||
}
|
||||
#ifdef IBMBIDI
|
||||
if (charType != eCharType_LeftToRight) {
|
||||
nsPresContext* presContext = GetPresContext();
|
||||
nsPresContext* presContext = PresContext();
|
||||
fm = presContext->GetMetricsFor(myFont->mFont);
|
||||
aRenderingContext.SetFont(fm);
|
||||
nscoord ascent;
|
||||
|
@ -1573,7 +1573,7 @@ nsBulletFrame::GetMinWidth(nsIRenderingContext *aRenderingContext)
|
|||
{
|
||||
nsHTMLReflowMetrics metrics;
|
||||
DISPLAY_MIN_WIDTH(this, metrics.width);
|
||||
GetDesiredSize(GetPresContext(), aRenderingContext, metrics);
|
||||
GetDesiredSize(PresContext(), aRenderingContext, metrics);
|
||||
return metrics.width;
|
||||
}
|
||||
|
||||
|
@ -1582,7 +1582,7 @@ nsBulletFrame::GetPrefWidth(nsIRenderingContext *aRenderingContext)
|
|||
{
|
||||
nsHTMLReflowMetrics metrics;
|
||||
DISPLAY_PREF_WIDTH(this, metrics.width);
|
||||
GetDesiredSize(GetPresContext(), aRenderingContext, metrics);
|
||||
GetDesiredSize(PresContext(), aRenderingContext, metrics);
|
||||
return metrics.width;
|
||||
}
|
||||
|
||||
|
@ -1603,7 +1603,7 @@ NS_IMETHODIMP nsBulletFrame::OnStartContainer(imgIRequest *aRequest,
|
|||
aImage->GetWidth(&w);
|
||||
aImage->GetHeight(&h);
|
||||
|
||||
nsPresContext* presContext = GetPresContext();
|
||||
nsPresContext* presContext = PresContext();
|
||||
|
||||
nsSize newsize(nsPresContext::CSSPixelsToAppUnits(w),
|
||||
nsPresContext::CSSPixelsToAppUnits(h));
|
||||
|
|
|
@ -427,7 +427,7 @@ nsColumnSetFrame::ReflowChildren(nsHTMLReflowMetrics& aDesiredSize,
|
|||
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;
|
||||
|
@ -456,7 +456,7 @@ nsColumnSetFrame::ReflowChildren(nsHTMLReflowMetrics& aDesiredSize,
|
|||
// 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);
|
||||
|
@ -476,7 +476,7 @@ nsColumnSetFrame::ReflowChildren(nsHTMLReflowMetrics& aDesiredSize,
|
|||
|
||||
*aBottomMarginCarriedOut = kidDesiredSize.mCarriedOutBottomMargin;
|
||||
|
||||
FinishReflowChild(child, GetPresContext(), &kidReflowState,
|
||||
FinishReflowChild(child, PresContext(), &kidReflowState,
|
||||
kidDesiredSize, childOrigin.x, childOrigin.y, 0);
|
||||
}
|
||||
|
||||
|
@ -501,7 +501,7 @@ nsColumnSetFrame::ReflowChildren(nsHTMLReflowMetrics& aDesiredSize,
|
|||
"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");
|
||||
|
@ -518,7 +518,7 @@ nsColumnSetFrame::ReflowChildren(nsHTMLReflowMetrics& aDesiredSize,
|
|||
// next-in-flow will eventually pick them up.
|
||||
nsIFrame* continuationColumns = child->GetNextSibling();
|
||||
if (continuationColumns) {
|
||||
SetOverflowFrames(GetPresContext(), continuationColumns);
|
||||
SetOverflowFrames(PresContext(), continuationColumns);
|
||||
child->SetNextSibling(nsnull);
|
||||
}
|
||||
break;
|
||||
|
@ -616,7 +616,7 @@ nsColumnSetFrame::DrainOverflowColumns()
|
|||
// 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;
|
||||
|
@ -625,7 +625,7 @@ nsColumnSetFrame::DrainOverflowColumns()
|
|||
|
||||
// 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;
|
||||
|
@ -640,7 +640,7 @@ nsColumnSetFrame::DrainOverflowColumns()
|
|||
|
||||
// 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);
|
||||
}
|
||||
|
@ -803,7 +803,7 @@ nsColumnSetFrame::Reflow(nsPresContext* aPresContext,
|
|||
}
|
||||
}
|
||||
|
||||
CheckInvalidateSizeChange(GetPresContext(), aDesiredSize, aReflowState);
|
||||
CheckInvalidateSizeChange(PresContext(), aDesiredSize, aReflowState);
|
||||
|
||||
FinishAndStoreOverflow(&aDesiredSize);
|
||||
aDesiredSize.mCarriedOutBottomMargin = carriedOutBottomMargin;
|
||||
|
|
|
@ -139,7 +139,7 @@ nsContainerFrame::AppendFrames(nsIAtom* aListName,
|
|||
#endif
|
||||
{
|
||||
AddStateBits(NS_FRAME_IS_DIRTY);
|
||||
GetPresContext()->PresShell()->
|
||||
PresContext()->PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eTreeChange);
|
||||
}
|
||||
}
|
||||
|
@ -173,7 +173,7 @@ nsContainerFrame::InsertFrames(nsIAtom* aListName,
|
|||
{
|
||||
// Ask the parent frame to reflow me.
|
||||
AddStateBits(NS_FRAME_IS_DIRTY);
|
||||
GetPresContext()->PresShell()->
|
||||
PresContext()->PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eTreeChange);
|
||||
}
|
||||
}
|
||||
|
@ -231,7 +231,7 @@ nsContainerFrame::RemoveFrame(nsIAtom* aListName,
|
|||
if (generateReflowCommand) {
|
||||
// Ask the parent frame to reflow me.
|
||||
AddStateBits(NS_FRAME_IS_DIRTY);
|
||||
GetPresContext()->PresShell()->
|
||||
PresContext()->PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eTreeChange);
|
||||
}
|
||||
}
|
||||
|
@ -251,7 +251,7 @@ nsContainerFrame::CleanupGeneratedContentIn(nsIContent* aRealContent,
|
|||
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);
|
||||
|
@ -273,7 +273,7 @@ nsContainerFrame::Destroy()
|
|||
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
|
||||
|
@ -291,7 +291,7 @@ nsContainerFrame::GetFirstChild(nsIAtom* aListName) const
|
|||
if (nsnull == aListName) {
|
||||
return mFrames.FirstChild();
|
||||
} else if (nsGkAtoms::overflowList == aListName) {
|
||||
return GetOverflowFrames(GetPresContext(), PR_FALSE);
|
||||
return GetOverflowFrames(PresContext(), PR_FALSE);
|
||||
} else {
|
||||
return nsnull;
|
||||
}
|
||||
|
|
|
@ -150,7 +150,7 @@ 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");
|
||||
|
|
|
@ -265,7 +265,7 @@ nsIFrameDebug::GetLogModuleInfo()
|
|||
void
|
||||
nsIFrameDebug::DumpFrameTree(nsIFrame* aFrame)
|
||||
{
|
||||
RootFrameList(aFrame->GetPresContext(), stdout, 0);
|
||||
RootFrameList(aFrame->PresContext(), stdout, 0);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -448,10 +448,10 @@ void SetFontFromStyle(nsIRenderingContext* aRC, nsStyleContext* aSC)
|
|||
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);
|
||||
|
@ -642,7 +642,7 @@ 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) ||
|
||||
|
@ -727,7 +727,7 @@ nsIFrame::GetUsedBorder() const
|
|||
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);
|
||||
|
@ -756,7 +756,7 @@ nsIFrame::GetUsedPadding() const
|
|||
|
||||
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,
|
||||
|
@ -867,7 +867,7 @@ 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) {
|
||||
|
@ -967,7 +967,7 @@ void nsDisplaySelectionOverlay::Paint(nsDisplayListBuilder* aBuilder,
|
|||
|
||||
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();
|
||||
|
@ -989,7 +989,7 @@ nsFrame::DisplaySelectionOverlay(nsDisplayListBuilder* aBuilder,
|
|||
if (!IsVisibleForPainting(aBuilder))
|
||||
return NS_OK;
|
||||
|
||||
nsPresContext* presContext = GetPresContext();
|
||||
nsPresContext* presContext = PresContext();
|
||||
nsIPresShell *shell = presContext->PresShell();
|
||||
if (!shell)
|
||||
return NS_OK;
|
||||
|
@ -1136,7 +1136,7 @@ static PRBool ApplyAbsPosClipping(nsDisplayListBuilder* aBuilder,
|
|||
// 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;
|
||||
|
@ -1314,7 +1314,7 @@ DisplayDebugBorders(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
|
|||
}
|
||||
// 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"));
|
||||
}
|
||||
|
@ -1512,7 +1512,7 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
|
|||
// 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
|
||||
|
@ -1527,7 +1527,7 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
|
|||
// 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;
|
||||
|
@ -2131,7 +2131,7 @@ nsFrame::HandleMultiplePress(nsPresContext* aPresContext,
|
|||
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);
|
||||
|
@ -2424,7 +2424,7 @@ NS_IMETHODIMP nsFrame::HandleRelease(nsPresContext* aPresContext,
|
|||
offsets = GetContentOffsetsFromPoint(pt);
|
||||
handleTableSelection = PR_FALSE;
|
||||
} else {
|
||||
GetDataForTableSelection(frameselection, GetPresContext()->PresShell(),
|
||||
GetDataForTableSelection(frameselection, PresContext()->PresShell(),
|
||||
(nsMouseEvent *)aEvent,
|
||||
getter_AddRefs(parentContent),
|
||||
&contentOffsetForTableSel,
|
||||
|
@ -2437,7 +2437,7 @@ NS_IMETHODIMP nsFrame::HandleRelease(nsPresContext* aPresContext,
|
|||
// 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();
|
||||
|
@ -3093,7 +3093,7 @@ nsFrame::IntrinsicWidthOffsets(nsIRenderingContext* aRenderingContext)
|
|||
|
||||
const nsStyleDisplay *disp = GetStyleDisplay();
|
||||
if (IsThemed(disp)) {
|
||||
nsPresContext *presContext = GetPresContext();
|
||||
nsPresContext *presContext = PresContext();
|
||||
|
||||
nsMargin border;
|
||||
presContext->GetTheme()->GetWidgetBorder(presContext->DeviceContext(),
|
||||
|
@ -3200,7 +3200,7 @@ nsFrame::ComputeSize(nsIRenderingContext *aRenderingContext,
|
|||
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);
|
||||
|
@ -3538,7 +3538,7 @@ nsIntRect nsIFrame::GetScreenRect() const
|
|||
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);
|
||||
|
@ -3690,7 +3690,7 @@ nsIFrame::Invalidate(const nsRect& aDamageRect,
|
|||
|
||||
// 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);
|
||||
|
@ -4019,7 +4019,7 @@ nsIFrame::IsVisibleForPainting() {
|
|||
if (!GetStyleVisibility()->IsVisible())
|
||||
return PR_FALSE;
|
||||
|
||||
nsPresContext* pc = GetPresContext();
|
||||
nsPresContext* pc = PresContext();
|
||||
if (!pc->IsRenderingOnlySelection())
|
||||
return PR_TRUE;
|
||||
|
||||
|
@ -4110,7 +4110,7 @@ nsFrameSelection* nsIFrame::GetFrameSelection()
|
|||
frame = frame->GetParent();
|
||||
}
|
||||
|
||||
return GetPresContext()->PresShell()->FrameSelection();
|
||||
return PresContext()->PresShell()->FrameSelection();
|
||||
}
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
|
@ -4877,7 +4877,7 @@ nsIFrame::PeekOffset(nsPeekOffsetStruct* aPos)
|
|||
//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,
|
||||
|
@ -4972,7 +4972,7 @@ nsIFrame::PeekOffset(nsPeekOffsetStruct* aPos)
|
|||
PRBool endOfLine = (eSelectEndLine == aPos->mAmount);
|
||||
|
||||
#ifdef IBMBIDI
|
||||
if (aPos->mVisual && GetPresContext()->BidiEnabled()) {
|
||||
if (aPos->mVisual && PresContext()->BidiEnabled()) {
|
||||
PRBool lineIsRTL;
|
||||
it->GetDirection(&lineIsRTL);
|
||||
PRBool isReordered;
|
||||
|
@ -5079,7 +5079,7 @@ 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;
|
||||
|
@ -5120,7 +5120,7 @@ nsIFrame::GetFrameFromDirection(nsDirection aDirection, PRBool aVisual,
|
|||
if (!aOutFrame || !aOutOffset || !aOutJumpedLine)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
nsPresContext* presContext = GetPresContext();
|
||||
nsPresContext* presContext = PresContext();
|
||||
*aOutFrame = nsnull;
|
||||
*aOutOffset = 0;
|
||||
*aOutJumpedLine = PR_FALSE;
|
||||
|
@ -5288,7 +5288,7 @@ nsIFrame::GetOverflowAreaProperty(PRBool aCreateIfNecessary)
|
|||
return nsnull;
|
||||
}
|
||||
|
||||
nsPropertyTable *propTable = GetPresContext()->PropertyTable();
|
||||
nsPropertyTable *propTable = PresContext()->PropertyTable();
|
||||
void *value = propTable->GetProperty(this,
|
||||
nsGkAtoms::overflowAreaProperty);
|
||||
|
||||
|
@ -5322,7 +5322,7 @@ nsIFrame::FinishAndStoreOverflow(nsRect* aOverflowArea, nsSize aNewSize)
|
|||
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)) {
|
||||
|
@ -5635,14 +5635,14 @@ nsIFrame::SetProperty(nsIAtom* aPropName,
|
|||
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);
|
||||
}
|
||||
|
||||
|
@ -5655,13 +5655,13 @@ nsIFrame::GetPropertyExternal(nsIAtom* aPropName, nsresult* aStatus) const
|
|||
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);
|
||||
}
|
||||
|
||||
|
@ -5687,7 +5687,7 @@ nsIFrame::IsFocusable(PRInt32 *aTabIndex, PRBool aWithMouse)
|
|||
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;
|
||||
|
|
|
@ -231,7 +231,7 @@ nsSubDocumentFrame::Init(nsIContent* aContent,
|
|||
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
|
||||
|
|
|
@ -443,7 +443,7 @@ nsFrameList::GetPrevVisualFor(nsIFrame* aFrame) const
|
|||
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) {
|
||||
|
@ -520,7 +520,7 @@ nsFrameList::GetNextVisualFor(nsIFrame* aFrame) const
|
|||
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) {
|
||||
|
|
|
@ -321,7 +321,7 @@ nsHTMLFramesetFrame::Init(nsIContent* aContent,
|
|||
}
|
||||
}
|
||||
|
||||
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();
|
||||
|
|
|
@ -252,7 +252,7 @@ struct ScrollReflowState {
|
|||
ScrollReflowState(nsIScrollableFrame* aFrame,
|
||||
const nsHTMLReflowState& aState) :
|
||||
mReflowState(aState),
|
||||
mBoxState(aState.frame->GetPresContext(), aState.rendContext),
|
||||
mBoxState(aState.frame->PresContext(), aState.rendContext),
|
||||
mStyles(aFrame->GetScrollbarStyles()) {
|
||||
}
|
||||
};
|
||||
|
@ -427,7 +427,7 @@ nsHTMLScrollFrame::ReflowScrolledFrame(const ScrollReflowState& aState,
|
|||
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;
|
||||
|
||||
|
@ -641,7 +641,7 @@ nsHTMLScrollFrame::PlaceScrollArea(const ScrollReflowState& aState)
|
|||
// 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,
|
||||
|
@ -670,7 +670,7 @@ nsHTMLScrollFrame::GetPrefWidth(nsIRenderingContext *aRenderingContext)
|
|||
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);
|
||||
|
@ -1420,7 +1420,7 @@ 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);
|
||||
|
@ -1514,7 +1514,7 @@ nsresult
|
|||
nsGfxScrollFrameInner::FireScrollPortEvent()
|
||||
{
|
||||
mAsyncScrollPortEvent.Forget();
|
||||
mOuter->GetPresContext()->GetPresShell()->
|
||||
mOuter->PresContext()->GetPresShell()->
|
||||
FlushPendingNotifications(Flush_OnlyReflow);
|
||||
if (mAsyncScrollPortEvent.IsPending()) {
|
||||
return NS_OK;
|
||||
|
@ -1565,7 +1565,7 @@ nsGfxScrollFrameInner::FireScrollPortEvent()
|
|||
nsnull);
|
||||
event.orient = orient;
|
||||
return nsEventDispatcher::Dispatch(mOuter->GetContent(),
|
||||
mOuter->GetPresContext(), &event);
|
||||
mOuter->PresContext(), &event);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1608,7 +1608,7 @@ nsGfxScrollFrameInner::ReloadChildFrames()
|
|||
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
|
||||
|
@ -1711,7 +1711,7 @@ nsGfxScrollFrameInner::Destroy()
|
|||
mScrollEvent.Revoke();
|
||||
mAsyncScrollPortEvent.Revoke();
|
||||
if (mPostedReflowCallback) {
|
||||
mOuter->GetPresContext()->PresShell()->CancelReflowCallback(this);
|
||||
mOuter->PresContext()->PresShell()->CancelReflowCallback(this);
|
||||
mPostedReflowCallback = PR_FALSE;
|
||||
}
|
||||
nsIScrollableView *view = GetScrollableView();
|
||||
|
@ -1837,7 +1837,7 @@ void nsGfxScrollFrameInner::CurPosAttributeChanged(nsIContent* aContent)
|
|||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1859,7 +1859,7 @@ nsGfxScrollFrameInner::FireScrollEvent()
|
|||
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) {
|
||||
|
@ -2047,7 +2047,7 @@ nsXULScrollFrame::LayoutScrollArea(nsBoxLayoutState& aState, const nsRect& aRect
|
|||
// 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);
|
||||
}
|
||||
|
@ -2075,7 +2075,7 @@ nsGfxScrollFrameInner::IsLTR() const
|
|||
// 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();
|
||||
|
||||
|
@ -2103,7 +2103,7 @@ nsGfxScrollFrameInner::IsLTR() const
|
|||
PRBool
|
||||
nsGfxScrollFrameInner::IsScrollbarOnRight() const
|
||||
{
|
||||
nsPresContext *presContext = mOuter->GetPresContext();
|
||||
nsPresContext *presContext = mOuter->PresContext();
|
||||
switch (presContext->GetCachedIntPref(kPresContext_ScrollbarSide)) {
|
||||
default:
|
||||
case 0: // UI directionality
|
||||
|
@ -2326,7 +2326,7 @@ nsGfxScrollFrameInner::ReflowFinished()
|
|||
mPostedReflowCallback = PR_FALSE;
|
||||
|
||||
// Update scrollbar attributes.
|
||||
nsPresContext* presContext = mOuter->GetPresContext();
|
||||
nsPresContext* presContext = mOuter->PresContext();
|
||||
|
||||
nsIScrollableView* scrollable = GetScrollableView();
|
||||
nsRect scrollArea = scrollable->View()->GetBounds();
|
||||
|
@ -2602,7 +2602,7 @@ nsGfxScrollFrameInner::GetCoordAttribute(nsIBox* aBox, nsIAtom* atom, PRInt32 de
|
|||
|
||||
static nsIURI* GetDocURI(nsIFrame* aFrame)
|
||||
{
|
||||
nsIPresShell* shell = aFrame->GetPresContext()->GetPresShell();
|
||||
nsIPresShell* shell = aFrame->PresContext()->GetPresShell();
|
||||
if (!shell)
|
||||
return nsnull;
|
||||
nsIDocument* doc = shell->GetDocument();
|
||||
|
|
|
@ -183,8 +183,8 @@ nsHTMLCanvasFrame::PaintCanvas(nsIRenderingContext& aRenderingContext,
|
|||
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!
|
||||
|
||||
|
|
|
@ -133,7 +133,7 @@ nsHTMLContainerFrame::DisplayTextDecorations(nsDisplayListBuilder* aBuilder,
|
|||
nsDisplayList* aAboveTextDecorations,
|
||||
nsLineBox* aLine)
|
||||
{
|
||||
if (eCompatibility_NavQuirks == GetPresContext()->CompatibilityMode())
|
||||
if (eCompatibility_NavQuirks == PresContext()->CompatibilityMode())
|
||||
return NS_OK;
|
||||
if (!IsVisibleForPainting(aBuilder))
|
||||
return NS_OK;
|
||||
|
@ -143,7 +143,7 @@ nsHTMLContainerFrame::DisplayTextDecorations(nsDisplayListBuilder* aBuilder,
|
|||
// 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) {
|
||||
|
@ -554,7 +554,7 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIFrame* aFrame,
|
|||
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
|
||||
|
|
|
@ -188,7 +188,7 @@ CanvasFrame::Init(nsIContent* aContent,
|
|||
{
|
||||
nsresult rv = nsHTMLContainerFrame::Init(aContent, aParent, aPrevInFlow);
|
||||
|
||||
mViewManager = GetPresContext()->GetViewManager();
|
||||
mViewManager = PresContext()->GetViewManager();
|
||||
|
||||
nsIScrollableView* scrollingView = nsnull;
|
||||
mViewManager->GetRootScrollableView(&scrollingView);
|
||||
|
@ -250,7 +250,7 @@ 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);
|
||||
}
|
||||
|
@ -281,7 +281,7 @@ CanvasFrame::AppendFrames(nsIAtom* aListName,
|
|||
#endif
|
||||
mFrames.AppendFrame(nsnull, aFrameList);
|
||||
|
||||
rv = GetPresContext()->PresShell()->
|
||||
rv = PresContext()->PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eTreeChange);
|
||||
}
|
||||
|
||||
|
@ -329,7 +329,7 @@ CanvasFrame::RemoveFrame(nsIAtom* aListName,
|
|||
mFrames.DestroyFrame(aOldFrame);
|
||||
|
||||
AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
rv = GetPresContext()->PresShell()->
|
||||
rv = PresContext()->PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eTreeChange);
|
||||
} else {
|
||||
rv = NS_ERROR_FAILURE;
|
||||
|
@ -375,7 +375,7 @@ public:
|
|||
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(),
|
||||
|
@ -491,7 +491,7 @@ CanvasFrame::PaintFocus(nsIRenderingContext& aRenderingContext, nsPoint aPt)
|
|||
focusRect.y += y;
|
||||
}
|
||||
|
||||
nsStyleOutline outlineStyle(GetPresContext());
|
||||
nsStyleOutline outlineStyle(PresContext());
|
||||
outlineStyle.SetOutlineStyle(NS_STYLE_BORDER_STYLE_DOTTED);
|
||||
outlineStyle.SetOutlineInitialColor();
|
||||
|
||||
|
|
|
@ -221,7 +221,7 @@ nsHTMLReflowState::SetComputedWidth(nscoord aComputedWidth)
|
|||
mComputedWidth = aComputedWidth;
|
||||
if (mComputedWidth != oldComputedWidth &&
|
||||
frame->GetType() != nsGkAtoms::viewportFrame) { // Or check GetParent()?
|
||||
InitResizeFlags(frame->GetPresContext());
|
||||
InitResizeFlags(frame->PresContext());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1686,7 +1686,7 @@ nsCSSOffsetState::InitOffsets(nscoord 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(),
|
||||
|
|
|
@ -404,7 +404,7 @@ class nsIFrame : public nsISupports
|
|||
public:
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFRAME_IID)
|
||||
|
||||
nsPresContext* GetPresContext() const {
|
||||
nsPresContext* PresContext() const {
|
||||
return GetStyleContext()->GetRuleNode()->GetPresContext();
|
||||
}
|
||||
|
||||
|
@ -775,7 +775,7 @@ public:
|
|||
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);
|
||||
}
|
||||
|
@ -2083,7 +2083,7 @@ public:
|
|||
|
||||
~nsWeakFrame()
|
||||
{
|
||||
Clear(mFrame ? mFrame->GetPresContext()->GetPresShell() : nsnull);
|
||||
Clear(mFrame ? mFrame->PresContext()->GetPresShell() : nsnull);
|
||||
}
|
||||
private:
|
||||
void Init(nsIFrame* aFrame);
|
||||
|
|
|
@ -280,7 +280,7 @@ nsImageFrame::Init(nsIContent* aContent,
|
|||
NS_ENSURE_TRUE(imageLoader, NS_ERROR_UNEXPECTED);
|
||||
imageLoader->AddObserver(mListener);
|
||||
|
||||
nsPresContext *aPresContext = GetPresContext();
|
||||
nsPresContext *aPresContext = PresContext();
|
||||
|
||||
if (!gIconLoad)
|
||||
LoadIcons(aPresContext);
|
||||
|
@ -516,7 +516,7 @@ nsImageFrame::OnStartContainer(imgIRequest *aRequest, imgIContainer *aImage)
|
|||
* 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();
|
||||
|
@ -604,7 +604,7 @@ nsImageFrame::OnStopDecode(imgIRequest *aRequest,
|
|||
nsresult aStatus,
|
||||
const PRUnichar *aStatusArg)
|
||||
{
|
||||
nsPresContext *presContext = GetPresContext();
|
||||
nsPresContext *presContext = PresContext();
|
||||
nsIPresShell *presShell = presContext->GetPresShell();
|
||||
NS_ASSERTION(presShell, "No PresShell.");
|
||||
|
||||
|
@ -718,7 +718,7 @@ nsImageFrame::ComputeSize(nsIRenderingContext *aRenderingContext,
|
|||
nsSize aMargin, nsSize aBorder, nsSize aPadding,
|
||||
PRBool aShrinkWrap)
|
||||
{
|
||||
nsPresContext *presContext = GetPresContext();
|
||||
nsPresContext *presContext = PresContext();
|
||||
EnsureIntrinsicSize(presContext);
|
||||
|
||||
return nsLayoutUtils::ComputeSizeWithIntrinsicDimensions(
|
||||
|
@ -752,7 +752,7 @@ nsImageFrame::GetMinWidth(nsIRenderingContext *aRenderingContext)
|
|||
// 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;
|
||||
|
@ -765,7 +765,7 @@ nsImageFrame::GetPrefWidth(nsIRenderingContext *aRenderingContext)
|
|||
// 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;
|
||||
|
@ -1037,8 +1037,8 @@ nsImageFrame::DisplayAltFeedback(nsIRenderingContext& aRenderingContext,
|
|||
}
|
||||
|
||||
// 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,
|
||||
|
@ -1108,7 +1108,7 @@ nsImageFrame::DisplayAltFeedback(nsIRenderingContext& aRenderingContext,
|
|||
nsXPIDLString altText;
|
||||
nsCSSFrameConstructor::GetAlternateTextFor(content, content->Tag(),
|
||||
altText);
|
||||
DisplayAltText(GetPresContext(), aRenderingContext, altText, inner);
|
||||
DisplayAltText(PresContext(), aRenderingContext, altText, inner);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1132,7 +1132,7 @@ 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();
|
||||
|
@ -1187,7 +1187,7 @@ nsImageFrame::PaintImage(nsIRenderingContext& aRenderingContext, nsPoint aPt,
|
|||
|
||||
nsLayoutUtils::DrawImage(&aRenderingContext, aImage, dest, clip);
|
||||
|
||||
nsPresContext* presContext = GetPresContext();
|
||||
nsPresContext* presContext = PresContext();
|
||||
nsImageMap* map = GetImageMap(presContext);
|
||||
if (nsnull != map) {
|
||||
aRenderingContext.PushState();
|
||||
|
@ -1248,7 +1248,7 @@ nsImageFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
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);
|
||||
|
@ -1260,7 +1260,7 @@ nsImageFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
// 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;
|
||||
|
@ -1536,7 +1536,7 @@ 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;
|
||||
|
@ -1549,7 +1549,7 @@ nsImageFrame::GetCursor(const nsPoint& aPoint,
|
|||
// 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(),
|
||||
|
@ -1577,7 +1577,7 @@ nsImageFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
|||
if (nsGkAtoms::alt == aAttribute)
|
||||
{
|
||||
AddStateBits(NS_FRAME_IS_DIRTY);
|
||||
GetPresContext()->PresShell()->FrameNeedsReflow(
|
||||
PresContext()->PresShell()->FrameNeedsReflow(
|
||||
NS_STATIC_CAST(nsIFrame*, this),
|
||||
nsIPresShell::eStyleChange);
|
||||
}
|
||||
|
|
|
@ -713,7 +713,7 @@ nsLineIterator::CheckLineOrder(PRInt32 aLine,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsPresContext* presContext = line->mFirstChild->GetPresContext();
|
||||
nsPresContext* presContext = line->mFirstChild->PresContext();
|
||||
|
||||
nsBidiPresUtils* bidiUtils = presContext->GetBidiUtils();
|
||||
|
||||
|
|
|
@ -754,7 +754,7 @@ nsObjectFrame::InstantiatePlugin(nsIPluginHost* aPluginHost,
|
|||
// 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;
|
||||
}
|
||||
|
@ -762,7 +762,7 @@ nsObjectFrame::InstantiatePlugin(nsIPluginHost* aPluginHost,
|
|||
void
|
||||
nsObjectFrame::FixupWindow(const nsSize& aSize)
|
||||
{
|
||||
nsPresContext* presContext = GetPresContext();
|
||||
nsPresContext* presContext = PresContext();
|
||||
|
||||
if (!mInstanceOwner)
|
||||
return;
|
||||
|
@ -857,8 +857,8 @@ nsPoint nsObjectFrame::GetWindowOriginInPixels(PRBool aWindowless)
|
|||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
@ -948,7 +948,7 @@ nsObjectFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
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)
|
||||
|
@ -988,7 +988,7 @@ nsObjectFrame::PrintPlugin(nsIRenderingContext& aRenderingContext,
|
|||
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;
|
||||
|
@ -1296,7 +1296,7 @@ nsObjectFrame::PrepareInstanceOwner()
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
NS_ADDREF(mInstanceOwner);
|
||||
mInstanceOwner->Init(GetPresContext(), this, GetContent());
|
||||
mInstanceOwner->Init(PresContext(), this, GetContent());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -1318,7 +1318,7 @@ nsObjectFrame::Instantiate(nsIChannel* aChannel, nsIStreamListener** aStreamList
|
|||
|
||||
// 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;
|
||||
}
|
||||
|
@ -1737,7 +1737,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetURL(const char *aURL, const char *aTarge
|
|||
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);
|
||||
|
@ -1804,7 +1804,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::ShowStatus(const PRUnichar *aStatusMsg)
|
|||
if (!mOwner) {
|
||||
return rv;
|
||||
}
|
||||
nsCOMPtr<nsISupports> cont = mOwner->GetPresContext()->GetContainer();
|
||||
nsCOMPtr<nsISupports> cont = mOwner->PresContext()->GetContainer();
|
||||
if (!cont) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -1850,7 +1850,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::InvalidateRect(nsPluginRect *invalidRect)
|
|||
nsIView* view = mOwner->GetView();
|
||||
|
||||
if (view) {
|
||||
nsPresContext* presContext = mOwner->GetPresContext();
|
||||
nsPresContext* presContext = mOwner->PresContext();
|
||||
|
||||
nsRect rect(presContext->DevPixelsToAppUnits(invalidRect->left),
|
||||
presContext->DevPixelsToAppUnits(invalidRect->top),
|
||||
|
@ -1889,7 +1889,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetValue(nsPluginInstancePeerVariable varia
|
|||
{
|
||||
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
|
||||
|
@ -2580,7 +2580,7 @@ NPDrawingModel nsPluginInstanceOwner::GetDrawingModel()
|
|||
|
||||
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
|
||||
|
@ -2898,7 +2898,7 @@ nsPluginInstanceOwner::MouseDown(nsIDOMEvent* aMouseEvent)
|
|||
// 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));
|
||||
|
@ -3170,7 +3170,7 @@ void nsPluginInstanceOwner::Paint(const nsRect& aDirtyRect, PRUint32 ndc)
|
|||
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
|
||||
|
@ -3361,7 +3361,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::CreateWidget(void)
|
|||
(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);
|
||||
|
|
|
@ -440,7 +440,7 @@ nsPageFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
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);
|
||||
|
@ -450,7 +450,7 @@ nsPageFrame::BuildDisplayList(nsDisplayListBuilder* 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);
|
||||
|
@ -508,7 +508,7 @@ void
|
|||
nsPageFrame::PaintHeaderFooter(nsIRenderingContext& aRenderingContext,
|
||||
nsPoint aPt)
|
||||
{
|
||||
nsPresContext* pc = GetPresContext();
|
||||
nsPresContext* pc = PresContext();
|
||||
|
||||
if (!mPD->mPrintSettings) {
|
||||
if (pc->Type() == nsPresContext::eContext_PrintPreview || pc->IsDynamic())
|
||||
|
@ -559,7 +559,7 @@ nsPageFrame::PaintPageContent(nsIRenderingContext& aRenderingContext,
|
|||
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
|
||||
|
@ -577,7 +577,7 @@ nsPageFrame::PaintPageContent(nsIRenderingContext& aRenderingContext,
|
|||
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);
|
||||
|
||||
|
|
|
@ -125,7 +125,7 @@ nsPlaceholderFrame::Reflow(nsPresContext* aPresContext,
|
|||
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 "
|
||||
|
|
|
@ -454,7 +454,7 @@ public:
|
|||
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(),
|
||||
|
|
|
@ -120,8 +120,8 @@ nsSimplePageSequenceFrame::nsSimplePageSequenceFrame(nsStyleContext* aContext) :
|
|||
|
||||
// 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);
|
||||
|
@ -366,8 +366,8 @@ nsSimplePageSequenceFrame::Reflow(nsPresContext* aPresContext,
|
|||
// 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);
|
||||
|
@ -557,7 +557,7 @@ nsSimplePageSequenceFrame::PrintNextPage()
|
|||
mPageData->mPrintSettings->GetPrintOptions(nsIPrintSettings::kPrintOddPages, &printOddPages);
|
||||
|
||||
// Begin printing of the document
|
||||
nsIDeviceContext *dc = GetPresContext()->DeviceContext();
|
||||
nsIDeviceContext *dc = PresContext()->DeviceContext();
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
|
@ -600,8 +600,8 @@ nsSimplePageSequenceFrame::PrintNextPage()
|
|||
// 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;
|
||||
|
@ -617,7 +617,7 @@ nsSimplePageSequenceFrame::PrintNextPage()
|
|||
|
||||
PRInt32 printedPageNum = 1;
|
||||
while (continuePrinting) {
|
||||
if (GetPresContext()->IsRootPaginatedDocument()) {
|
||||
if (PresContext()->IsRootPaginatedDocument()) {
|
||||
PR_PL(("\n"));
|
||||
PR_PL(("***************** BeginPage *****************\n"));
|
||||
rv = dc->BeginPage();
|
||||
|
@ -627,7 +627,7 @@ nsSimplePageSequenceFrame::PrintNextPage()
|
|||
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),
|
||||
|
@ -657,9 +657,9 @@ 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);
|
||||
}
|
||||
|
||||
|
@ -684,7 +684,7 @@ nsSimplePageSequenceFrame::PaintPageSequence(nsIRenderingContext& aRenderingCont
|
|||
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);
|
||||
|
|
|
@ -1447,7 +1447,7 @@ nsContinuingTextFrame::Init(nsIContent* aContent,
|
|||
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);
|
||||
|
@ -2022,7 +2022,7 @@ void
|
|||
nsTextFrame::PaintText(nsIRenderingContext& aRenderingContext, nsPoint aPt)
|
||||
{
|
||||
nsStyleContext* sc = mStyleContext;
|
||||
nsPresContext* presContext = GetPresContext();
|
||||
nsPresContext* presContext = PresContext();
|
||||
nsCOMPtr<nsIContent> content;
|
||||
PRInt32 offset, length;
|
||||
GetContentAndOffsetsForSelection(presContext,
|
||||
|
@ -2785,7 +2785,7 @@ nsTextFrame::IsTextInSelection()
|
|||
PRBool isSelected;
|
||||
PRBool hideStandardSelection;
|
||||
PRInt16 selectionValue;
|
||||
nsPresContext* presContext = GetPresContext();
|
||||
nsPresContext* presContext = PresContext();
|
||||
if (NS_FAILED(GetTextInfoForPainting(presContext,
|
||||
getter_AddRefs(shell),
|
||||
getter_AddRefs(selCon),
|
||||
|
@ -3177,7 +3177,7 @@ nsTextFrame::GetPositionSlowly(nsIRenderingContext* aRendContext,
|
|||
// 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) {
|
||||
|
@ -3218,7 +3218,7 @@ nsTextFrame::GetPositionSlowly(nsIRenderingContext* aRendContext,
|
|||
}
|
||||
|
||||
// Transform text from content into renderable form
|
||||
nsTextTransformer tx(GetPresContext());
|
||||
nsTextTransformer tx(PresContext());
|
||||
PRInt32 textLength;
|
||||
PRIntn numJustifiableCharacter;
|
||||
|
||||
|
@ -4107,7 +4107,7 @@ nsTextFrame::GetPositionHelper(const nsPoint& aPoint,
|
|||
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;
|
||||
|
@ -4134,7 +4134,7 @@ nsTextFrame::GetPositionHelper(const nsPoint& aPoint,
|
|||
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);
|
||||
|
@ -4534,7 +4534,7 @@ nsTextFrame::PeekOffsetCharacter(PRBool aForward, PRInt32* aOffset)
|
|||
if (startOffset < 0)
|
||||
startOffset = mContentLength;
|
||||
|
||||
nsPresContext* presContext = GetPresContext();
|
||||
nsPresContext* presContext = PresContext();
|
||||
|
||||
// Transform text from content into renderable form
|
||||
nsAutoTextBuffer paintBuffer;
|
||||
|
@ -4669,7 +4669,7 @@ nsTextFrame::PeekOffsetWord(PRBool aForward, PRBool aWordSelectEatSpace, PRBool
|
|||
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;
|
||||
|
@ -5675,7 +5675,7 @@ nsTextFrame::AddInlineMinWidth(nsIRenderingContext *aRenderingContext,
|
|||
{
|
||||
nsresult rv;
|
||||
|
||||
nsPresContext *presContext = GetPresContext();
|
||||
nsPresContext *presContext = PresContext();
|
||||
nsTextStyle ts(presContext, *aRenderingContext, mStyleContext);
|
||||
SetupTextRunDirection(presContext, aRenderingContext);
|
||||
if (!ts.mFont->mSize)
|
||||
|
@ -5815,7 +5815,7 @@ nsTextFrame::AddInlinePrefWidth(nsIRenderingContext *aRenderingContext,
|
|||
{
|
||||
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
|
||||
|
|
|
@ -1992,7 +1992,7 @@ void nsDisplayMathMLSelectionRect::Paint(nsDisplayListBuilder* aBuilder,
|
|||
{
|
||||
// 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));
|
||||
|
@ -2025,7 +2025,7 @@ void nsDisplayMathMLCharBackground::Paint(nsDisplayListBuilder* aBuilder,
|
|||
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,
|
||||
|
@ -2056,7 +2056,7 @@ private:
|
|||
void nsDisplayMathMLCharForeground::Paint(nsDisplayListBuilder* aBuilder,
|
||||
nsIRenderingContext* aCtx, const nsRect& aDirtyRect)
|
||||
{
|
||||
mChar->PaintForeground(mFrame->GetPresContext(), *aCtx,
|
||||
mChar->PaintForeground(mFrame->PresContext(), *aCtx,
|
||||
aBuilder->ToReferenceFrame(mFrame), mIsSelected);
|
||||
}
|
||||
|
||||
|
@ -2085,7 +2085,7 @@ void nsDisplayMathMLCharDebug::Paint(nsDisplayListBuilder* aBuilder,
|
|||
{
|
||||
// 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);
|
||||
|
|
|
@ -647,7 +647,7 @@ nsMathMLContainerFrame::PropagateScriptStyleFor(nsIFrame* aFrame,
|
|||
}
|
||||
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
|
||||
|
@ -703,7 +703,7 @@ nsMathMLContainerFrame::PropagateScriptStyleFor(nsIFrame* aFrame,
|
|||
}
|
||||
|
||||
// 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
|
||||
|
@ -774,7 +774,7 @@ 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);
|
||||
|
@ -874,7 +874,7 @@ nsMathMLContainerFrame::ReLayoutChildren(nsIFrame* aParentFrame)
|
|||
if (!parent)
|
||||
return NS_OK;
|
||||
|
||||
return frame->GetPresContext()->PresShell()->
|
||||
return frame->PresContext()->PresShell()->
|
||||
FrameNeedsReflow(frame, nsIPresShell::eStyleChange);
|
||||
}
|
||||
|
||||
|
@ -950,13 +950,13 @@ nsMathMLContainerFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
|||
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);
|
||||
}
|
||||
|
||||
|
@ -1333,7 +1333,7 @@ nsMathMLContainerFrame::Place(nsIRenderingContext& aRenderingContext,
|
|||
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;
|
||||
|
@ -1428,7 +1428,7 @@ nsMathMLContainerFrame::DidReflowChildren(nsIFrame* aFirst, nsIFrame* 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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -337,7 +337,7 @@ public:
|
|||
{
|
||||
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;
|
||||
}
|
||||
|
@ -420,7 +420,7 @@ public:
|
|||
{
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -279,7 +279,7 @@ public:
|
|||
nscoord& aSubDrop)
|
||||
{
|
||||
const nsStyleFont* font = aChild->GetStyleFont();
|
||||
nsCOMPtr<nsIFontMetrics> fm = aChild->GetPresContext()->GetMetricsFor(
|
||||
nsCOMPtr<nsIFontMetrics> fm = aChild->PresContext()->GetMetricsFor(
|
||||
font->mFont);
|
||||
GetSubDrop(fm, aSubDrop);
|
||||
}
|
||||
|
@ -289,7 +289,7 @@ public:
|
|||
nscoord& aSupDrop)
|
||||
{
|
||||
const nsStyleFont* font = aChild->GetStyleFont();
|
||||
nsCOMPtr<nsIFontMetrics> fm = aChild->GetPresContext()->GetMetricsFor(
|
||||
nsCOMPtr<nsIFontMetrics> fm = aChild->PresContext()->GetMetricsFor(
|
||||
font->mFont);
|
||||
GetSupDrop(fm, aSupDrop);
|
||||
}
|
||||
|
|
|
@ -186,7 +186,7 @@ nsMathMLTokenFrame::Place(nsIRenderingContext& aRenderingContext,
|
|||
nsHTMLReflowMetrics& aDesiredSize)
|
||||
{
|
||||
nsCOMPtr<nsIFontMetrics> fm =
|
||||
GetPresContext()->GetMetricsFor(GetStyleFont()->mFont);
|
||||
PresContext()->GetMetricsFor(GetStyleFont()->mFont);
|
||||
nscoord ascent, descent;
|
||||
fm->GetMaxAscent(ascent);
|
||||
fm->GetMaxDescent(descent);
|
||||
|
@ -208,7 +208,7 @@ nsMathMLTokenFrame::Place(nsIRenderingContext& aRenderingContext,
|
|||
|
||||
// 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();
|
||||
}
|
||||
|
@ -255,7 +255,7 @@ nsMathMLTokenFrame::ProcessTextData(PRBool 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
|
||||
|
|
|
@ -142,7 +142,7 @@ nsMathMLmactionFrame::Init(nsIContent* aContent,
|
|||
|
||||
// then, re-resolve our style
|
||||
nsStyleContext* parentStyleContext = aParent->GetStyleContext();
|
||||
newStyleContext = GetPresContext()->StyleSet()->
|
||||
newStyleContext = PresContext()->StyleSet()->
|
||||
ResolveStyleFor(aContent, parentStyleContext);
|
||||
|
||||
if (!newStyleContext)
|
||||
|
@ -311,7 +311,7 @@ nsMathMLmactionFrame::Place(nsIRenderingContext& aRenderingContext,
|
|||
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;
|
||||
|
@ -357,7 +357,7 @@ nsMathMLmactionFrame::MouseOver(nsIDOMEvent* aMouseEvent)
|
|||
// 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;
|
||||
|
@ -370,7 +370,7 @@ nsMathMLmactionFrame::MouseOut(nsIDOMEvent* aMouseEvent)
|
|||
if (NS_MATHML_ACTION_TYPE_STATUSLINE == mActionType) {
|
||||
nsAutoString value;
|
||||
value.SetLength(0);
|
||||
ShowStatus(GetPresContext(), value);
|
||||
ShowStatus(PresContext(), value);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -390,7 +390,7 @@ nsMathMLmactionFrame::MouseClick(nsIDOMEvent* aMouseEvent)
|
|||
|
||||
// Now trigger a content-changed reflow...
|
||||
mSelectedFrame->AddStateBits(NS_FRAME_IS_DIRTY);
|
||||
GetPresContext()->PresShell()->
|
||||
PresContext()->PresShell()->
|
||||
FrameNeedsReflow(mSelectedFrame, nsIPresShell::eTreeChange);
|
||||
}
|
||||
}
|
||||
|
@ -406,7 +406,7 @@ nsMathMLmactionFrame::MouseClick(nsIDOMEvent* aMouseEvent)
|
|||
|
||||
// Trigger a style change reflow
|
||||
mSelectedFrame->AddStateBits(NS_FRAME_IS_DIRTY);
|
||||
GetPresContext()->PresShell()->
|
||||
PresContext()->PresShell()->
|
||||
FrameNeedsReflow(mSelectedFrame, nsIPresShell::eStyleChange);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ nsMathMLmfencedFrame::SetInitialChildList(nsIAtom* aListName,
|
|||
// 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
|
||||
|
@ -95,7 +95,7 @@ nsMathMLmfencedFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
|||
PRInt32 aModType)
|
||||
{
|
||||
RemoveFencesAndSeparators();
|
||||
CreateFencesAndSeparators(GetPresContext());
|
||||
CreateFencesAndSeparators(PresContext());
|
||||
|
||||
return nsMathMLContainerFrame::
|
||||
AttributeChanged(aNameSpaceID, aAttribute, aModType);
|
||||
|
@ -105,7 +105,7 @@ nsresult
|
|||
nsMathMLmfencedFrame::ChildListChanged(PRInt32 aModType)
|
||||
{
|
||||
RemoveFencesAndSeparators();
|
||||
CreateFencesAndSeparators(GetPresContext());
|
||||
CreateFencesAndSeparators(PresContext());
|
||||
|
||||
return nsMathMLContainerFrame::ChildListChanged(aModType);
|
||||
}
|
||||
|
|
|
@ -104,7 +104,7 @@ nsMathMLmfracFrame::Init(nsIContent* aContent,
|
|||
// enable the bevelled rendering
|
||||
mSlashChar = new nsMathMLChar();
|
||||
if (mSlashChar) {
|
||||
nsPresContext* presContext = GetPresContext();
|
||||
nsPresContext* presContext = PresContext();
|
||||
|
||||
nsAutoString slashChar; slashChar.Assign(kSlashChar);
|
||||
mSlashChar->SetData(presContext, slashChar);
|
||||
|
@ -288,7 +288,7 @@ nsMathMLmfracFrame::Place(nsIRenderingContext& aRenderingContext,
|
|||
//////////////////
|
||||
// Get shifts
|
||||
|
||||
nsPresContext* presContext = GetPresContext();
|
||||
nsPresContext* presContext = PresContext();
|
||||
nscoord onePixel = nsPresContext::CSSPixelsToAppUnits(1);
|
||||
|
||||
aRenderingContext.SetFont(GetStyleFont()->mFont, nsnull);
|
||||
|
@ -465,7 +465,7 @@ nsMathMLmfracFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
|||
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);
|
||||
|
|
|
@ -126,7 +126,7 @@ nsMathMLmmultiscriptsFrame::ProcessAttributes()
|
|||
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
|
||||
|
@ -135,7 +135,7 @@ nsMathMLmmultiscriptsFrame::ProcessAttributes()
|
|||
if (!value.IsEmpty()) {
|
||||
nsCSSValue cssValue;
|
||||
if (ParseNumericValue(value, cssValue) && cssValue.IsLengthUnit()) {
|
||||
mSupScriptShift = CalcLength(GetPresContext(), mStyleContext, cssValue);
|
||||
mSupScriptShift = CalcLength(PresContext(), mStyleContext, cssValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -171,7 +171,7 @@ nsMathMLmmultiscriptsFrame::Place(nsIRenderingContext& aRenderingContext,
|
|||
// 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
|
||||
|
@ -418,7 +418,7 @@ nsMathMLmmultiscriptsFrame::Place(nsIRenderingContext& aRenderingContext,
|
|||
// 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) {
|
||||
|
@ -441,12 +441,12 @@ nsMathMLmmultiscriptsFrame::Place(nsIRenderingContext& aRenderingContext,
|
|||
|
||||
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;
|
||||
|
|
|
@ -170,7 +170,7 @@ nsMathMLmoFrame::ProcessTextData(PRBool aComputeStyleChange)
|
|||
|
||||
// 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);
|
||||
|
@ -317,7 +317,7 @@ nsMathMLmoFrame::ProcessOperatorData()
|
|||
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
|
||||
|
@ -747,7 +747,7 @@ nsMathMLmoFrame::Stretch(nsIRenderingContext& aRenderingContext,
|
|||
}
|
||||
|
||||
// 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)
|
||||
|
|
|
@ -256,11 +256,11 @@ nsMathMLmoverFrame::Place(nsIRenderingContext& aRenderingContext,
|
|||
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));
|
||||
}
|
||||
|
||||
////////////////////////////////////
|
||||
|
@ -403,11 +403,11 @@ nsMathMLmoverFrame::Place(nsIRenderingContext& aRenderingContext,
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ nsMathMLmrootFrame::Init(nsIContent* aContent,
|
|||
{
|
||||
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
|
||||
|
|
|
@ -92,7 +92,7 @@ nsMathMLmsqrtFrame::Init(nsIContent* aContent,
|
|||
{
|
||||
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
|
||||
|
|
|
@ -160,7 +160,7 @@ nsMathMLmstyleFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
|||
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
|
||||
|
|
|
@ -87,7 +87,7 @@ nsMathMLmsubFrame::Place (nsIRenderingContext& aRenderingContext,
|
|||
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;
|
||||
|
@ -97,11 +97,11 @@ nsMathMLmsubFrame::Place (nsIRenderingContext& aRenderingContext,
|
|||
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,
|
||||
|
|
|
@ -102,7 +102,7 @@ nsMathMLmsubsupFrame::Place(nsIRenderingContext& aRenderingContext,
|
|||
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
|
||||
|
@ -112,11 +112,11 @@ nsMathMLmsubsupFrame::Place(nsIRenderingContext& aRenderingContext,
|
|||
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,
|
||||
|
|
|
@ -87,7 +87,7 @@ nsMathMLmsupFrame::Place(nsIRenderingContext& aRenderingContext,
|
|||
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;
|
||||
|
@ -97,11 +97,11 @@ nsMathMLmsupFrame::Place(nsIRenderingContext& aRenderingContext,
|
|||
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,
|
||||
|
|
|
@ -357,7 +357,7 @@ nsMathMLmtableOuterFrame::Init(nsIContent* aContent,
|
|||
nsIFrame* aPrevInFlow)
|
||||
{
|
||||
nsresult rv = nsTableOuterFrame::Init(aContent, aParent, aPrevInFlow);
|
||||
nsMathMLFrame::MapCommonAttributesIntoCSS(GetPresContext(), aContent);
|
||||
nsMathMLFrame::MapCommonAttributesIntoCSS(PresContext(), aContent);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -419,7 +419,7 @@ nsMathMLmtableOuterFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
|||
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>:
|
||||
|
@ -447,7 +447,7 @@ nsMathMLmtableOuterFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
|||
|
||||
// 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;
|
||||
}
|
||||
|
@ -458,7 +458,7 @@ nsMathMLmtableOuterFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
|||
if (aAttribute == nsGkAtoms::displaystyle_) {
|
||||
nsMathMLContainerFrame::RebuildAutomaticDataForChildren(mParent);
|
||||
nsMathMLContainerFrame::PropagateScriptStyleFor(tableFrame, mPresentationData.scriptLevel);
|
||||
GetPresContext()->PresShell()->
|
||||
PresContext()->PresShell()->
|
||||
FrameNeedsReflow(mParent, nsIPresShell::eStyleChange);
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -501,7 +501,7 @@ nsMathMLmtableOuterFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
|||
}
|
||||
|
||||
// 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;
|
||||
|
@ -684,7 +684,7 @@ nsMathMLmtableFrame::RestyleTable()
|
|||
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);
|
||||
}
|
||||
|
||||
|
@ -711,7 +711,7 @@ nsMathMLmtrFrame::Init(nsIContent* aContent,
|
|||
nsIFrame* aPrevInFlow)
|
||||
{
|
||||
nsresult rv = nsTableRowFrame::Init(aContent, aParent, aPrevInFlow);
|
||||
nsMathMLFrame::MapCommonAttributesIntoCSS(GetPresContext(), aContent);
|
||||
nsMathMLFrame::MapCommonAttributesIntoCSS(PresContext(), aContent);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -721,7 +721,7 @@ nsMathMLmtrFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
|||
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>:
|
||||
|
@ -757,7 +757,7 @@ nsMathMLmtrFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
|||
}
|
||||
|
||||
// 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;
|
||||
|
@ -786,7 +786,7 @@ nsMathMLmtdFrame::Init(nsIContent* aContent,
|
|||
nsIFrame* aPrevInFlow)
|
||||
{
|
||||
nsresult rv = nsTableCellFrame::Init(aContent, aParent, aPrevInFlow);
|
||||
nsMathMLFrame::MapCommonAttributesIntoCSS(GetPresContext(), aContent);
|
||||
nsMathMLFrame::MapCommonAttributesIntoCSS(PresContext(), aContent);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -834,7 +834,7 @@ nsMathMLmtdFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
|||
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>:
|
||||
|
|
|
@ -253,11 +253,11 @@ nsMathMLmunderFrame::Place(nsIRenderingContext& aRenderingContext,
|
|||
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));
|
||||
}
|
||||
|
||||
////////////////////////////////////
|
||||
|
@ -356,10 +356,10 @@ nsMathMLmunderFrame::Place(nsIRenderingContext& aRenderingContext,
|
|||
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;
|
||||
|
|
|
@ -290,11 +290,11 @@ nsMathMLmunderoverFrame::Place(nsIRenderingContext& aRenderingContext,
|
|||
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));
|
||||
}
|
||||
|
||||
////////////////////////////////////
|
||||
|
@ -478,13 +478,13 @@ nsMathMLmunderoverFrame::Place(nsIRenderingContext& aRenderingContext,
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -2617,7 +2617,7 @@ nsComputedDOMStyle::GetBorderWidthFor(PRUint8 aSide, nsIDOMCSSValue** aValue)
|
|||
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);
|
||||
|
|
|
@ -158,7 +158,7 @@ nsSVGForeignObjectFrame::MarkIntrinsicWidthsDirty()
|
|||
// 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);
|
||||
}
|
||||
|
||||
|
@ -479,7 +479,7 @@ void nsSVGForeignObjectFrame::PostChildDirty()
|
|||
nsIFrame* kid = GetFirstChild(nsnull);
|
||||
if (!kid)
|
||||
return;
|
||||
GetPresContext()->PresShell()->
|
||||
PresContext()->PresShell()->
|
||||
FrameNeedsReflow(kid, nsIPresShell::eStyleChange);
|
||||
}
|
||||
|
||||
|
@ -526,7 +526,7 @@ nsSVGForeignObjectFrame::DoReflow()
|
|||
if (mParent->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)
|
||||
return;
|
||||
|
||||
nsPresContext *presContext = GetPresContext();
|
||||
nsPresContext *presContext = PresContext();
|
||||
nsIFrame* kid = GetFirstChild(nsnull);
|
||||
if (!kid)
|
||||
return;
|
||||
|
|
|
@ -85,7 +85,7 @@ nsSVGGeometryFrame::GetPaintServer(const nsStyleSVGPaint *aPaint)
|
|||
|
||||
nsIFrame *result;
|
||||
if (NS_FAILED(nsSVGUtils::GetReferencedFrame(&result, uri, mContent,
|
||||
GetPresContext()->PresShell())))
|
||||
PresContext()->PresShell())))
|
||||
return nsnull;
|
||||
|
||||
nsIAtom *type = result->GetType();
|
||||
|
@ -198,7 +198,7 @@ nsSVGGeometryFrame::GetStrokeWidth()
|
|||
mContent->GetParent() : mContent);
|
||||
|
||||
return
|
||||
nsSVGUtils::CoordToFloat(GetPresContext(),
|
||||
nsSVGUtils::CoordToFloat(PresContext(),
|
||||
ctx,
|
||||
GetStyleSVG()->mStrokeWidth);
|
||||
}
|
||||
|
@ -214,7 +214,7 @@ nsSVGGeometryFrame::GetStrokeDashArray(gfxFloat **aDashes, PRUint32 *aCount)
|
|||
|
||||
if (count) {
|
||||
const nsStyleCoord *dasharray = GetStyleSVG()->mStrokeDasharray;
|
||||
nsPresContext *presContext = GetPresContext();
|
||||
nsPresContext *presContext = PresContext();
|
||||
gfxFloat totalLength = 0.0f;
|
||||
|
||||
dashes = new gfxFloat[count];
|
||||
|
@ -250,7 +250,7 @@ float
|
|||
nsSVGGeometryFrame::GetStrokeDashoffset()
|
||||
{
|
||||
return
|
||||
nsSVGUtils::CoordToFloat(GetPresContext(),
|
||||
nsSVGUtils::CoordToFloat(PresContext(),
|
||||
NS_STATIC_CAST(nsSVGElement*, mContent),
|
||||
GetStyleSVG()->mStrokeDashoffset);
|
||||
}
|
||||
|
|
|
@ -672,7 +672,7 @@ nsSVGGlyphFrame::GetHighlight(PRUint32 *charnum, PRUint32 *nchars,
|
|||
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:
|
||||
|
@ -1293,7 +1293,7 @@ void nsSVGGlyphFrame::SelectFont(gfxContext *aContext)
|
|||
// 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);
|
||||
|
|
|
@ -428,7 +428,7 @@ nsSVGGradientFrame::GetRefedGradientFromHref()
|
|||
// 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)
|
||||
|
|
|
@ -385,7 +385,7 @@ nsSVGOuterSVGFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
|||
!(GetStateBits() & NS_FRAME_FIRST_REFLOW) &&
|
||||
(aAttribute == nsGkAtoms::width || aAttribute == nsGkAtoms::height)) {
|
||||
AddStateBits(NS_FRAME_IS_DIRTY);
|
||||
GetPresContext()->PresShell()->
|
||||
PresContext()->PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eStyleChange);
|
||||
}
|
||||
|
||||
|
@ -399,8 +399,8 @@ nsSVGOuterSVGFrame::GetFrameForPoint(const nsPoint& aPoint)
|
|||
// 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)) {
|
||||
|
@ -469,7 +469,7 @@ nsSVGOuterSVGFrame::Paint(nsIRenderingContext& aRenderingContext,
|
|||
PRTime start = PR_Now();
|
||||
#endif
|
||||
|
||||
dirtyRect.ScaleRoundOut(1.0f / GetPresContext()->AppUnitsPerDevPixel());
|
||||
dirtyRect.ScaleRoundOut(1.0f / PresContext()->AppUnitsPerDevPixel());
|
||||
|
||||
nsSVGRenderState ctx(&aRenderingContext);
|
||||
|
||||
|
@ -511,7 +511,7 @@ nsSVGOuterSVGFrame::GetType() const
|
|||
nsresult
|
||||
nsSVGOuterSVGFrame::InvalidateRect(nsRect aRect)
|
||||
{
|
||||
aRect.ScaleRoundOut(GetPresContext()->AppUnitsPerDevPixel());
|
||||
aRect.ScaleRoundOut(PresContext()->AppUnitsPerDevPixel());
|
||||
Invalidate(aRect);
|
||||
|
||||
return NS_OK;
|
||||
|
@ -640,7 +640,7 @@ 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
|
||||
|
|
|
@ -565,7 +565,7 @@ nsSVGPatternFrame::checkURITarget(void) {
|
|||
if (NS_SUCCEEDED(
|
||||
nsSVGUtils::GetReferencedFrame(&nextPattern, targetURI,
|
||||
mContent,
|
||||
GetPresContext()->PresShell()))) {
|
||||
PresContext()->PresShell()))) {
|
||||
nsIAtom* frameType = nextPattern->GetType();
|
||||
if (frameType != nsGkAtoms::svgPatternFrame)
|
||||
return PR_FALSE;
|
||||
|
|
|
@ -181,7 +181,7 @@ nsSVGTextPathFrame::GetPathFrame() {
|
|||
mContent->GetCurrentDoc(), base);
|
||||
|
||||
nsSVGUtils::GetReferencedFrame(&path, targetURI, mContent,
|
||||
GetPresContext()->PresShell());
|
||||
PresContext()->PresShell());
|
||||
if (!path || (path->GetType() != nsGkAtoms::svgPathGeometryFrame))
|
||||
return nsnull;
|
||||
return path;
|
||||
|
|
|
@ -125,7 +125,7 @@ GetWidthInfo(nsIRenderingContext *aRenderingContext,
|
|||
// 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)) {
|
||||
|
@ -224,7 +224,7 @@ BasicTableLayoutStrategy::ComputeColumnIntrinsicWidths(nsIRenderingContext* aRen
|
|||
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.
|
||||
|
|
|
@ -1196,7 +1196,7 @@ nsTableCellMap::SetBCBorderCorner(Corner aCorner,
|
|||
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");
|
||||
|
|
|
@ -174,7 +174,7 @@ nsTableCellFrame::NeedsToObserve(const nsHTMLReflowState& aReflowState)
|
|||
// (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);
|
||||
}
|
||||
|
||||
|
@ -276,7 +276,7 @@ nsTableCellFrame::DecorateForSelection(nsIRenderingContext& aRenderingContext,
|
|||
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();
|
||||
|
@ -325,7 +325,7 @@ nsTableCellFrame::PaintBackground(nsIRenderingContext& aRenderingContext,
|
|||
nsPoint aPt)
|
||||
{
|
||||
nsRect rect(aPt, GetSize());
|
||||
nsCSSRendering::PaintBackground(GetPresContext(), aRenderingContext, this,
|
||||
nsCSSRendering::PaintBackground(PresContext(), aRenderingContext, this,
|
||||
aDirtyRect, rect, *GetStyleBorder(),
|
||||
*GetStylePadding(), PR_TRUE);
|
||||
}
|
||||
|
@ -427,7 +427,7 @@ nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
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) {
|
||||
|
@ -585,7 +585,7 @@ void nsTableCellFrame::VerticallyAlignChild(nscoord aMaxAscent)
|
|||
nsContainerFrame::PositionChildViews(firstKid);
|
||||
}
|
||||
if (HasView()) {
|
||||
nsContainerFrame::SyncFrameViewAfterReflow(GetPresContext(), this,
|
||||
nsContainerFrame::SyncFrameViewAfterReflow(PresContext(), this,
|
||||
GetView(),
|
||||
&desiredSize.mOverflowArea, 0);
|
||||
}
|
||||
|
@ -1081,7 +1081,7 @@ nsBCTableCellFrame::PaintBackground(nsIRenderingContext& aRenderingContext,
|
|||
}
|
||||
|
||||
nsRect rect(aPt, GetSize());
|
||||
nsCSSRendering::PaintBackground(GetPresContext(), aRenderingContext, this,
|
||||
nsCSSRendering::PaintBackground(PresContext(), aRenderingContext, this,
|
||||
aDirtyRect, rect, myBorder, *GetStylePadding(),
|
||||
PR_TRUE);
|
||||
}
|
||||
|
|
|
@ -270,7 +270,7 @@ nsTableColGroupFrame::InsertColsReflow(PRInt32 aColIndex,
|
|||
return;
|
||||
|
||||
tableFrame->AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
GetPresContext()->PresShell()->FrameNeedsReflow(tableFrame,
|
||||
PresContext()->PresShell()->FrameNeedsReflow(tableFrame,
|
||||
nsIPresShell::eTreeChange);
|
||||
}
|
||||
|
||||
|
@ -302,7 +302,7 @@ nsTableColGroupFrame::RemoveChild(nsTableColFrame& aChild,
|
|||
return;
|
||||
|
||||
tableFrame->AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
GetPresContext()->PresShell()->FrameNeedsReflow(tableFrame,
|
||||
PresContext()->PresShell()->FrameNeedsReflow(tableFrame,
|
||||
nsIPresShell::eTreeChange);
|
||||
}
|
||||
|
||||
|
@ -326,7 +326,7 @@ nsTableColGroupFrame::RemoveFrame(nsIAtom* aListName,
|
|||
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 {
|
||||
|
|
|
@ -415,7 +415,7 @@ void nsTableFrame::AttributeChangedFor(nsIFrame* aFrame,
|
|||
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);
|
||||
}
|
||||
}
|
||||
|
@ -701,7 +701,7 @@ nsTableColGroupFrame*
|
|||
nsTableFrame::CreateAnonymousColGroupFrame(nsTableColGroupType aColGroupType)
|
||||
{
|
||||
nsIContent* colGroupContent = GetContent();
|
||||
nsPresContext* presContext = GetPresContext();
|
||||
nsPresContext* presContext = PresContext();
|
||||
nsIPresShell *shell = presContext->PresShell();
|
||||
|
||||
nsRefPtr<nsStyleContext> colGroupStyle;
|
||||
|
@ -784,7 +784,7 @@ nsTableFrame::CreateAnonymousColFrames(nsTableColGroupFrame* aColGroupFrame,
|
|||
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
|
||||
|
@ -1405,7 +1405,7 @@ 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);
|
||||
|
@ -2003,7 +2003,7 @@ nsTableFrame::ReflowTable(nsHTMLReflowMetrics& aDesiredSize,
|
|||
// 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);
|
||||
|
@ -2087,13 +2087,13 @@ nsTableFrame::PushChildren(const nsAutoVoidArray& aFrames,
|
|||
// 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());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2259,7 +2259,7 @@ nsTableFrame::AppendFrames(nsIAtom* aListName,
|
|||
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();
|
||||
|
||||
|
@ -2367,7 +2367,7 @@ nsTableFrame::InsertFrames(nsIAtom* aListName,
|
|||
}
|
||||
|
||||
AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
GetPresContext()->PresShell()->FrameNeedsReflow(this,
|
||||
PresContext()->PresShell()->FrameNeedsReflow(this,
|
||||
nsIPresShell::eTreeChange);
|
||||
SetGeometryDirty();
|
||||
#ifdef DEBUG_TABLE_CELLMAP
|
||||
|
@ -2447,7 +2447,7 @@ nsTableFrame::RemoveFrame(nsIAtom* aListName,
|
|||
SetBCDamageArea(damageArea);
|
||||
}
|
||||
AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
GetPresContext()->PresShell()->FrameNeedsReflow(this,
|
||||
PresContext()->PresShell()->FrameNeedsReflow(this,
|
||||
nsIPresShell::eTreeChange);
|
||||
SetGeometryDirty();
|
||||
#ifdef DEBUG_TABLE_CELLMAP
|
||||
|
@ -2506,7 +2506,7 @@ nsTableFrame::GetOuterBCBorder() const
|
|||
nsMargin
|
||||
nsTableFrame::GetIncludedOuterBCBorder() const
|
||||
{
|
||||
if (eCompatibility_NavQuirks == GetPresContext()->CompatibilityMode()) {
|
||||
if (eCompatibility_NavQuirks == PresContext()->CompatibilityMode()) {
|
||||
return GetOuterBCBorder();
|
||||
}
|
||||
nsMargin border(0, 0, 0, 0);
|
||||
|
@ -2516,7 +2516,7 @@ nsTableFrame::GetIncludedOuterBCBorder() const
|
|||
nsMargin
|
||||
nsTableFrame::GetExcludedOuterBCBorder() const
|
||||
{
|
||||
if (eCompatibility_NavQuirks != GetPresContext()->CompatibilityMode()) {
|
||||
if (eCompatibility_NavQuirks != PresContext()->CompatibilityMode()) {
|
||||
return GetOuterBCBorder();
|
||||
}
|
||||
nsMargin border(0, 0, 0, 0);
|
||||
|
@ -2542,7 +2542,7 @@ 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();
|
||||
|
@ -2583,7 +2583,7 @@ 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) {
|
||||
|
@ -2608,7 +2608,7 @@ void nsTableFrame::PlaceChild(nsTableReflowState& aReflowState,
|
|||
{
|
||||
|
||||
// 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
|
||||
|
@ -2718,7 +2718,7 @@ nsTableFrame::ReflowChildren(nsTableReflowState& aReflowState,
|
|||
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();
|
||||
|
||||
|
@ -2950,7 +2950,7 @@ 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.
|
||||
|
@ -2986,7 +2986,7 @@ nsTableFrame::CalcDesiredHeight(const nsHTMLReflowState& aReflowState, nsHTMLRef
|
|||
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;
|
||||
}
|
||||
|
@ -6509,7 +6509,7 @@ 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
|
||||
|
|
|
@ -261,7 +261,7 @@ nsTableOuterFrame::AppendFrames(nsIAtom* aListName,
|
|||
// 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);
|
||||
|
||||
}
|
||||
|
@ -315,7 +315,7 @@ nsTableOuterFrame::RemoveFrame(nsIAtom* aListName,
|
|||
mCaptionFrame = mCaptionFrames.FirstChild();
|
||||
|
||||
AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN); // also means child removed
|
||||
GetPresContext()->PresShell()->
|
||||
PresContext()->PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eTreeChange);
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -197,7 +197,7 @@ nsTableRowFrame::AppendFrames(nsIAtom* aListName,
|
|||
}
|
||||
|
||||
AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
GetPresContext()->PresShell()->FrameNeedsReflow(this,
|
||||
PresContext()->PresShell()->FrameNeedsReflow(this,
|
||||
nsIPresShell::eTreeChange);
|
||||
tableFrame->SetGeometryDirty();
|
||||
|
||||
|
@ -238,7 +238,7 @@ nsTableRowFrame::InsertFrames(nsIAtom* aListName,
|
|||
mFrames.InsertFrames(nsnull, aPrevFrame, aFrameList);
|
||||
|
||||
AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
GetPresContext()->PresShell()->FrameNeedsReflow(this,
|
||||
PresContext()->PresShell()->FrameNeedsReflow(this,
|
||||
nsIPresShell::eTreeChange);
|
||||
tableFrame->SetGeometryDirty();
|
||||
|
||||
|
@ -264,7 +264,7 @@ nsTableRowFrame::RemoveFrame(nsIAtom* aListName,
|
|||
mFrames.DestroyFrame(aOldFrame);
|
||||
|
||||
AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
GetPresContext()->PresShell()->FrameNeedsReflow(this,
|
||||
PresContext()->PresShell()->FrameNeedsReflow(this,
|
||||
nsIPresShell::eTreeChange);
|
||||
tableFrame->SetGeometryDirty();
|
||||
}
|
||||
|
@ -369,7 +369,7 @@ nsTableRowFrame::DidResize()
|
|||
}
|
||||
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
|
||||
}
|
||||
|
@ -568,7 +568,7 @@ nsDisplayTableRowBackground::Paint(nsDisplayListBuilder* aBuilder,
|
|||
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));
|
||||
}
|
||||
|
|
|
@ -200,7 +200,7 @@ PaintRowGroupBackground(nsIFrame* aFrame, nsIRenderingContext* aCtx,
|
|||
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));
|
||||
}
|
||||
|
@ -1343,7 +1343,7 @@ nsTableRowGroupFrame::AppendFrames(nsIAtom* aListName,
|
|||
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();
|
||||
}
|
||||
|
@ -1393,7 +1393,7 @@ nsTableRowGroupFrame::InsertFrames(nsIAtom* aListName,
|
|||
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();
|
||||
}
|
||||
|
@ -1415,7 +1415,7 @@ nsTableRowGroupFrame::RemoveFrame(nsIAtom* aListName,
|
|||
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();
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ nsGridRowLeafFrame::GetBorderAndPadding(nsMargin& aBorderAndPadding)
|
|||
|
||||
PRBool isHorizontal = IsHorizontal();
|
||||
|
||||
nsBoxLayoutState state((nsPresContext*) GetPresContext());
|
||||
nsBoxLayoutState state((nsPresContext*) PresContext());
|
||||
|
||||
PRInt32 firstIndex = 0;
|
||||
PRInt32 lastIndex = 0;
|
||||
|
|
|
@ -283,7 +283,7 @@ nsBox::SetBounds(nsBoxLayoutState& aState, const nsRect& aRect, PRBool aRemoveOv
|
|||
// 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);
|
||||
}
|
||||
|
@ -342,7 +342,7 @@ nsBox::GetBorder(nsMargin& aMargin)
|
|||
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,
|
||||
|
@ -366,7 +366,7 @@ 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;
|
||||
|
|
|
@ -170,7 +170,7 @@ nsBoxFrame::SetInitialChildList(nsIAtom* aListName,
|
|||
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());
|
||||
|
@ -644,7 +644,7 @@ 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
|
||||
|
@ -665,7 +665,7 @@ 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
|
||||
|
@ -1001,7 +1001,7 @@ nsBoxFrame::MarkIntrinsicWidthsDirty()
|
|||
CoordNeedsRecalc(mAscent);
|
||||
|
||||
if (mLayoutManager) {
|
||||
nsBoxLayoutState state(GetPresContext());
|
||||
nsBoxLayoutState state(PresContext());
|
||||
mLayoutManager->IntrinsicWidthsDirty(this, state);
|
||||
}
|
||||
|
||||
|
@ -1014,7 +1014,7 @@ 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
|
||||
|
@ -1029,7 +1029,7 @@ nsBoxFrame::RemoveFrame(nsIAtom* aListName,
|
|||
|
||||
// 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;
|
||||
}
|
||||
|
@ -1042,7 +1042,7 @@ nsBoxFrame::InsertFrames(nsIAtom* aListName,
|
|||
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);
|
||||
|
@ -1058,7 +1058,7 @@ nsBoxFrame::InsertFrames(nsIAtom* aListName,
|
|||
#endif
|
||||
|
||||
mState |= NS_FRAME_HAS_DIRTY_CHILDREN;
|
||||
GetPresContext()->PresShell()->
|
||||
PresContext()->PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eTreeChange);
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -1069,7 +1069,7 @@ 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);
|
||||
|
@ -1086,7 +1086,7 @@ nsBoxFrame::AppendFrames(nsIAtom* aListName,
|
|||
|
||||
if (!(GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
|
||||
mState |= NS_FRAME_HAS_DIRTY_CHILDREN;
|
||||
GetPresContext()->PresShell()->
|
||||
PresContext()->PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eTreeChange);
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -1201,15 +1201,15 @@ nsBoxFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
|||
}
|
||||
|
||||
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?");
|
||||
}
|
||||
|
@ -1221,7 +1221,7 @@ nsBoxFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
|||
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);
|
||||
}
|
||||
}
|
||||
|
@ -1925,7 +1925,7 @@ nsBoxFrame::RegUnregAccessKey(PRBool aDoReg)
|
|||
|
||||
// With a valid PresContext we can get the ESM
|
||||
// and register the access key
|
||||
nsIEventStateManager *esm = GetPresContext()->EventStateManager();
|
||||
nsIEventStateManager *esm = PresContext()->EventStateManager();
|
||||
|
||||
nsresult rv;
|
||||
|
||||
|
@ -1943,7 +1943,7 @@ nsBoxFrame::FireDOMEventSynch(const nsAString& aDOMEventName, nsIContent *aConte
|
|||
{
|
||||
// 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
|
||||
|
|
|
@ -155,7 +155,7 @@ nsButtonBoxFrame::DoMouseClick(nsGUIEvent* aEvent, PRBool aTrustEvent)
|
|||
}
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ nsDeckFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
|||
|
||||
// if the index changed hide the old element and make the new element visible
|
||||
if (aAttribute == nsGkAtoms::selectedIndex) {
|
||||
IndexChanged(GetPresContext());
|
||||
IndexChanged(PresContext());
|
||||
}
|
||||
|
||||
return rv;
|
||||
|
|
|
@ -152,7 +152,7 @@ nsGroupBoxFrame::PaintBorderBackground(nsIRenderingContext& aRenderingContext,
|
|||
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);
|
||||
|
|
|
@ -173,7 +173,7 @@ nsImageBoxFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
|||
if (aAttribute == nsGkAtoms::src) {
|
||||
UpdateImage();
|
||||
AddStateBits(NS_FRAME_IS_DIRTY);
|
||||
GetPresContext()->PresShell()->
|
||||
PresContext()->PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eStyleChange);
|
||||
}
|
||||
else if (aAttribute == nsGkAtoms::validate)
|
||||
|
@ -508,7 +508,7 @@ NS_IMETHODIMP nsImageBoxFrame::OnStartContainer(imgIRequest *request,
|
|||
nsPresContext::CSSPixelsToAppUnits(h));
|
||||
|
||||
AddStateBits(NS_FRAME_IS_DIRTY);
|
||||
GetPresContext()->PresShell()->
|
||||
PresContext()->PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eStyleChange);
|
||||
|
||||
return NS_OK;
|
||||
|
@ -517,7 +517,7 @@ NS_IMETHODIMP nsImageBoxFrame::OnStartContainer(imgIRequest *request,
|
|||
NS_IMETHODIMP nsImageBoxFrame::OnStopContainer(imgIRequest *request,
|
||||
imgIContainer *image)
|
||||
{
|
||||
nsBoxLayoutState state(GetPresContext());
|
||||
nsBoxLayoutState state(PresContext());
|
||||
this->Redraw(state);
|
||||
|
||||
return NS_OK;
|
||||
|
@ -534,7 +534,7 @@ NS_IMETHODIMP nsImageBoxFrame::OnStopDecode(imgIRequest *request,
|
|||
// 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);
|
||||
}
|
||||
|
@ -546,7 +546,7 @@ NS_IMETHODIMP nsImageBoxFrame::FrameChanged(imgIContainer *container,
|
|||
gfxIImageFrame *newframe,
|
||||
nsRect * dirtyRect)
|
||||
{
|
||||
nsBoxLayoutState state(GetPresContext());
|
||||
nsBoxLayoutState state(PresContext());
|
||||
this->Redraw(state);
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -186,7 +186,7 @@ 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
|
||||
|
@ -206,7 +206,7 @@ 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
|
||||
|
|
|
@ -255,7 +255,7 @@ nsListBoxBodyFrame::Init(nsIContent* aContent,
|
|||
scrollbarFrame->SetScrollbarMediatorContent(GetContent());
|
||||
|
||||
nsCOMPtr<nsIFontMetrics> fm;
|
||||
GetPresContext()->DeviceContext()->GetMetricsFor(
|
||||
PresContext()->DeviceContext()->GetMetricsFor(
|
||||
GetStyleContext()->GetStyleFont()->mFont, *getter_AddRefs(fm)
|
||||
);
|
||||
fm->GetHeight(mRowHeight);
|
||||
|
@ -268,7 +268,7 @@ 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()) {
|
||||
|
@ -317,7 +317,7 @@ nsListBoxBodyFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
|||
mContent->SetAttr(kNameSpaceID_None, nsGkAtoms::minheight, value, PR_FALSE);
|
||||
|
||||
AddStateBits(NS_FRAME_IS_DIRTY);
|
||||
GetPresContext()->PresShell()->
|
||||
PresContext()->PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eStyleChange);
|
||||
}
|
||||
}
|
||||
|
@ -502,7 +502,7 @@ nsListBoxBodyFrame::ReflowFinished()
|
|||
// 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)
|
||||
|
@ -607,7 +607,7 @@ nsListBoxBodyFrame::ScrollByLines(PRInt32 aNumLines)
|
|||
|
||||
// I'd use Composite here, but it doesn't always work.
|
||||
// vm->Composite();
|
||||
GetPresContext()->GetViewManager()->ForceUpdate();
|
||||
PresContext()->GetViewManager()->ForceUpdate();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -831,7 +831,7 @@ nsListBoxBodyFrame::PostReflowCallback()
|
|||
{
|
||||
if (!mReflowCallbackPosted) {
|
||||
mReflowCallbackPosted = PR_TRUE;
|
||||
GetPresContext()->PresShell()->PostReflowCallback(this);
|
||||
PresContext()->PresShell()->PostReflowCallback(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -888,7 +888,7 @@ 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
|
||||
|
@ -931,7 +931,7 @@ nsListBoxBodyFrame::InternalPositionChanged(PRBool aUp, PRInt32 aDelta)
|
|||
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!
|
||||
|
@ -1049,7 +1049,7 @@ 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;
|
||||
|
@ -1061,7 +1061,7 @@ nsListBoxBodyFrame::DestroyRows(PRInt32& aRowsToLose)
|
|||
}
|
||||
|
||||
AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
GetPresContext()->PresShell()->
|
||||
PresContext()->PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eTreeChange);
|
||||
}
|
||||
|
||||
|
@ -1071,7 +1071,7 @@ 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;
|
||||
|
@ -1084,7 +1084,7 @@ nsListBoxBodyFrame::ReverseDestroyRows(PRInt32& aRowsToLose)
|
|||
}
|
||||
|
||||
AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
GetPresContext()->PresShell()->
|
||||
PresContext()->PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eTreeChange);
|
||||
}
|
||||
|
||||
|
@ -1140,7 +1140,7 @@ nsListBoxBodyFrame::GetFirstItemBox(PRInt32 aOffset, PRBool* aCreated)
|
|||
// 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,
|
||||
|
@ -1189,7 +1189,7 @@ nsListBoxBodyFrame::GetNextItemBox(nsIBox* aBox, PRInt32 aOffset,
|
|||
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);
|
||||
|
@ -1215,7 +1215,7 @@ nsListBoxBodyFrame::GetNextItemBox(nsIBox* aBox, PRInt32 aOffset,
|
|||
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
|
||||
|
@ -1234,7 +1234,7 @@ nsListBoxBodyFrame::ContinueReflow(nscoord height)
|
|||
// 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();
|
||||
|
@ -1243,7 +1243,7 @@ nsListBoxBodyFrame::ContinueReflow(nscoord height)
|
|||
}
|
||||
|
||||
AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
GetPresContext()->PresShell()->
|
||||
PresContext()->PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eTreeChange);
|
||||
}
|
||||
return PR_FALSE;
|
||||
|
@ -1256,12 +1256,12 @@ 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;
|
||||
|
@ -1271,12 +1271,12 @@ 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;
|
||||
|
@ -1318,7 +1318,7 @@ nsListBoxBodyFrame::OnContentInserted(nsPresContext* aPresContext, nsIContent* a
|
|||
|
||||
CreateRows();
|
||||
AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
GetPresContext()->PresShell()->
|
||||
PresContext()->PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eTreeChange);
|
||||
}
|
||||
|
||||
|
@ -1391,7 +1391,7 @@ nsListBoxBodyFrame::OnContentRemoved(nsPresContext* aPresContext, nsIFrame* aChi
|
|||
}
|
||||
|
||||
AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
GetPresContext()->PresShell()->
|
||||
PresContext()->PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eTreeChange);
|
||||
}
|
||||
|
||||
|
@ -1451,7 +1451,7 @@ void
|
|||
nsListBoxBodyFrame::RemoveChildFrame(nsBoxLayoutState &aState,
|
||||
nsIFrame *aFrame)
|
||||
{
|
||||
nsPresContext* presContext = GetPresContext();
|
||||
nsPresContext* presContext = PresContext();
|
||||
nsCSSFrameConstructor* fc = presContext->PresShell()->FrameConstructor();
|
||||
fc->RemoveMappingsForFrameSubtree(aFrame);
|
||||
|
||||
|
|
|
@ -188,7 +188,7 @@ nsMenuBarFrame::SetActive(PRBool aActiveFlag)
|
|||
// 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;
|
||||
|
||||
|
@ -294,7 +294,7 @@ nsMenuBarFrame::FindMenuWithShortcut(nsIDOMKeyEvent* aKeyEvent)
|
|||
|
||||
// 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;
|
||||
|
||||
|
@ -442,7 +442,7 @@ nsMenuBarFrame::KeyboardNavigation(PRUint32 aKeyCode, PRBool& aHandledFlag)
|
|||
nsMenuBarFrame::GetNextMenuItem(nsIMenuFrame* aStart)
|
||||
{
|
||||
nsIFrame* immediateParent = nsnull;
|
||||
GetInsertionPoint(GetPresContext()->PresShell(), this, nsnull, &immediateParent);
|
||||
GetInsertionPoint(PresContext()->PresShell(), this, nsnull, &immediateParent);
|
||||
if (!immediateParent)
|
||||
immediateParent = this;
|
||||
|
||||
|
@ -492,7 +492,7 @@ nsMenuBarFrame::GetNextMenuItem(nsIMenuFrame* aStart)
|
|||
nsMenuBarFrame::GetPreviousMenuItem(nsIMenuFrame* aStart)
|
||||
{
|
||||
nsIFrame* immediateParent = nsnull;
|
||||
GetInsertionPoint(GetPresContext()->PresShell(), this, nsnull, &immediateParent);
|
||||
GetInsertionPoint(PresContext()->PresShell(), this, nsnull, &immediateParent);
|
||||
if (!immediateParent)
|
||||
immediateParent = this;
|
||||
|
||||
|
|
|
@ -181,7 +181,7 @@ public:
|
|||
CallQueryInterface(mWeakFrame.GetFrame(), &imenu);
|
||||
if (imenu) {
|
||||
nsMenuFrame* menu = NS_STATIC_CAST(nsMenuFrame*, imenu);
|
||||
menu->UpdateMenuType(menu->GetPresContext());
|
||||
menu->UpdateMenuType(menu->PresContext());
|
||||
shouldFlush = PR_TRUE;
|
||||
}
|
||||
}
|
||||
|
@ -249,7 +249,7 @@ nsMenuFrame::Init(nsIContent* aContent,
|
|||
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;
|
||||
}
|
||||
|
||||
|
@ -373,7 +373,7 @@ nsMenuFrame::Destroy()
|
|||
|
||||
UngenerateMenu();
|
||||
ENSURE_TRUE(weakFrame.IsAlive());
|
||||
DestroyPopupFrames(GetPresContext());
|
||||
DestroyPopupFrames(PresContext());
|
||||
nsBoxFrame::Destroy();
|
||||
}
|
||||
|
||||
|
@ -719,7 +719,7 @@ nsMenuFrame::ActivateMenu(PRBool aActivateFlag)
|
|||
|
||||
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);
|
||||
|
@ -738,7 +738,7 @@ nsMenuFrame::ActivateMenu(PRBool aActivateFlag)
|
|||
}
|
||||
// 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;
|
||||
|
@ -753,7 +753,7 @@ nsMenuFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
|||
|
||||
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);
|
||||
|
@ -761,7 +761,7 @@ nsMenuFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
|||
} else if (aAttribute == nsGkAtoms::key) {
|
||||
BuildAcceleratorText();
|
||||
} else if ( aAttribute == nsGkAtoms::type || aAttribute == nsGkAtoms::name )
|
||||
UpdateMenuType(GetPresContext());
|
||||
UpdateMenuType(PresContext());
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -801,7 +801,7 @@ nsMenuFrame::OpenMenuInternal(PRBool aActivateFlag)
|
|||
if (!mIsMenu)
|
||||
return;
|
||||
|
||||
nsPresContext* presContext = GetPresContext();
|
||||
nsPresContext* presContext = PresContext();
|
||||
nsWeakFrame weakFrame(this);
|
||||
|
||||
if (aActivateFlag) {
|
||||
|
@ -1696,7 +1696,7 @@ nsMenuFrame::Execute(nsGUIEvent *aEvent)
|
|||
// 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) {
|
||||
|
@ -1726,7 +1726,7 @@ nsMenuFrame::OnCreate()
|
|||
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
nsCOMPtr<nsIPresShell> shell = GetPresContext()->GetPresShell();
|
||||
nsCOMPtr<nsIPresShell> shell = PresContext()->GetPresShell();
|
||||
if (shell) {
|
||||
if (child) {
|
||||
rv = shell->HandleDOMEventWithTarget(child, &event, &status);
|
||||
|
@ -1799,7 +1799,7 @@ nsMenuFrame::OnCreated()
|
|||
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);
|
||||
|
@ -1825,7 +1825,7 @@ nsMenuFrame::OnDestroy()
|
|||
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);
|
||||
|
@ -1851,7 +1851,7 @@ nsMenuFrame::OnDestroyed()
|
|||
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);
|
||||
|
@ -1876,7 +1876,7 @@ nsMenuFrame::RemoveFrame(nsIAtom* aListName,
|
|||
// 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 {
|
||||
|
@ -1903,7 +1903,7 @@ nsMenuFrame::InsertFrames(nsIAtom* aListName,
|
|||
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 {
|
||||
|
@ -1932,7 +1932,7 @@ nsMenuFrame::AppendFrames(nsIAtom* aListName,
|
|||
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 {
|
||||
|
@ -1959,7 +1959,7 @@ public:
|
|||
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);
|
||||
|
@ -1996,7 +1996,7 @@ nsMenuFrame::SizeToPopup(nsBoxLayoutState& aState, nsSize& aSize)
|
|||
nsGkAtoms::menugenerated)) {
|
||||
nsIReflowCallback* cb = new nsASyncMenuGeneration(this);
|
||||
if (cb) {
|
||||
GetPresContext()->PresShell()->PostReflowCallback(cb);
|
||||
PresContext()->PresShell()->PostReflowCallback(cb);
|
||||
}
|
||||
}
|
||||
return PR_FALSE;
|
||||
|
@ -2073,7 +2073,7 @@ nsMenuFrame::SetActiveChild(nsIDOMElement* aChild)
|
|||
|
||||
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;
|
||||
|
|
|
@ -160,7 +160,7 @@ nsMenuPopupFrame::Init(nsIContent* aContent,
|
|||
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
|
||||
|
@ -214,12 +214,12 @@ nsMenuPopupFrame::CreateWidgetForView(nsIView* aView)
|
|||
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)) ||
|
||||
|
@ -421,7 +421,7 @@ nsMenuPopupFrame::AdjustClientXYForNestedDocuments ( nsIDOMXULDocument* inPopupD
|
|||
}
|
||||
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) +
|
||||
|
@ -743,7 +743,7 @@ nsMenuPopupFrame::SyncViewWithFrame(nsPresContext* aPresContext,
|
|||
if (!window)
|
||||
return NS_OK;
|
||||
|
||||
nsIDeviceContext* devContext = GetPresContext()->DeviceContext();
|
||||
nsIDeviceContext* devContext = PresContext()->DeviceContext();
|
||||
nsRect rect;
|
||||
if ( mMenuCanOverlapOSBar ) {
|
||||
devContext->GetRect(rect);
|
||||
|
@ -997,7 +997,7 @@ nsMenuPopupFrame::SyncViewWithFrame(nsPresContext* aPresContext,
|
|||
nsBoxFrame::SetPosition(frameOrigin);
|
||||
|
||||
if (sizedToPopup) {
|
||||
nsBoxLayoutState state(GetPresContext());
|
||||
nsBoxLayoutState state(PresContext());
|
||||
SetBounds(state, nsRect(mRect.x, mRect.y, parentRect.width, mRect.height));
|
||||
}
|
||||
|
||||
|
@ -1007,7 +1007,7 @@ nsMenuPopupFrame::SyncViewWithFrame(nsPresContext* aPresContext,
|
|||
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;
|
||||
|
@ -1026,7 +1026,7 @@ static void GetInsertionPoint(nsIPresShell* aShell, nsIFrame* aFrame, nsIFrame*
|
|||
nsMenuPopupFrame::GetNextMenuItem(nsIMenuFrame* aStart)
|
||||
{
|
||||
nsIFrame* immediateParent = nsnull;
|
||||
GetInsertionPoint(GetPresContext()->PresShell(), this, nsnull,
|
||||
GetInsertionPoint(PresContext()->PresShell(), this, nsnull,
|
||||
&immediateParent);
|
||||
if (!immediateParent)
|
||||
immediateParent = this;
|
||||
|
@ -1077,7 +1077,7 @@ nsMenuPopupFrame::GetNextMenuItem(nsIMenuFrame* aStart)
|
|||
nsMenuPopupFrame::GetPreviousMenuItem(nsIMenuFrame* aStart)
|
||||
{
|
||||
nsIFrame* immediateParent = nsnull;
|
||||
GetInsertionPoint(GetPresContext()->PresShell(), this, nsnull,
|
||||
GetInsertionPoint(PresContext()->PresShell(), this, nsnull,
|
||||
&immediateParent);
|
||||
if (!immediateParent)
|
||||
immediateParent = this;
|
||||
|
@ -1274,7 +1274,7 @@ NS_IMETHODIMP nsMenuPopupFrame::SetCurrentMenuItem(nsIMenuFrame* aMenuItem)
|
|||
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.
|
||||
|
@ -1307,7 +1307,7 @@ nsMenuPopupFrame::Escape(PRBool& aHandledFlag)
|
|||
// 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);
|
||||
|
@ -1373,7 +1373,7 @@ nsMenuPopupFrame::FindMenuWithShortcut(nsIDOMKeyEvent* aKeyEvent, PRBool& doActi
|
|||
|
||||
// Enumerate over our list of frames.
|
||||
nsIFrame* immediateParent = nsnull;
|
||||
GetInsertionPoint(GetPresContext()->PresShell(), this, nsnull,
|
||||
GetInsertionPoint(PresContext()->PresShell(), this, nsnull,
|
||||
&immediateParent);
|
||||
if (!immediateParent)
|
||||
immediateParent = this;
|
||||
|
@ -1693,7 +1693,7 @@ nsMenuPopupFrame::HideChain()
|
|||
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);
|
||||
|
@ -1729,7 +1729,7 @@ nsMenuPopupFrame::DismissChain()
|
|||
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) {
|
||||
|
@ -1820,7 +1820,7 @@ nsMenuPopupFrame::IsValidItem(nsIContent* aContent)
|
|||
nsIAtom *tag = aContent->Tag();
|
||||
|
||||
PRBool skipNavigatingDisabledMenuItem;
|
||||
GetPresContext()->LookAndFeel()->
|
||||
PresContext()->LookAndFeel()->
|
||||
GetMetric(nsILookAndFeel::eMetric_SkipNavigatingDisabledMenuItem,
|
||||
skipNavigatingDisabledMenuItem);
|
||||
|
||||
|
@ -1893,7 +1893,7 @@ nsMenuPopupFrame::Destroy()
|
|||
if (mCloseTimer)
|
||||
mCloseTimer->Cancel();
|
||||
|
||||
nsPresContext* rootPresContext = GetPresContext()->RootPresContext();
|
||||
nsPresContext* rootPresContext = PresContext()->RootPresContext();
|
||||
if (rootPresContext->ContainsActivePopup(this)) {
|
||||
rootPresContext->NotifyRemovedActivePopup(this);
|
||||
}
|
||||
|
|
|
@ -1,355 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2002
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
|
||||
#include "nsNativeScrollbarFrame.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsBoxLayoutState.h"
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsGUIEvent.h"
|
||||
#include "nsIDeviceContext.h"
|
||||
#include "nsIView.h"
|
||||
#include "nsINativeScrollbar.h"
|
||||
#include "nsIScrollbarFrame.h"
|
||||
#include "nsIScrollbarMediator.h"
|
||||
#include "nsWidgetsCID.h"
|
||||
#include "nsINameSpaceManager.h"
|
||||
|
||||
//
|
||||
// NS_NewNativeScrollbarFrame
|
||||
//
|
||||
// Creates a new scrollbar frame and returns it
|
||||
//
|
||||
nsIFrame*
|
||||
NS_NewNativeScrollbarFrame (nsIPresShell* aPresShell, nsStyleContext* aContext)
|
||||
{
|
||||
return new (aPresShell) nsNativeScrollbarFrame (aPresShell, aContext);
|
||||
} // NS_NewNativeScrollbarFrame
|
||||
|
||||
|
||||
//
|
||||
// QueryInterface
|
||||
//
|
||||
NS_IMETHODIMP
|
||||
nsNativeScrollbarFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
{
|
||||
if (!aInstancePtr) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
if (aIID.Equals(NS_GET_IID(nsIScrollbarMediator))) {
|
||||
*aInstancePtr = (void*) ((nsIScrollbarMediator*) this);
|
||||
return NS_OK;
|
||||
}
|
||||
return nsBoxFrame::QueryInterface(aIID, aInstancePtr);
|
||||
}
|
||||
|
||||
//
|
||||
// Init
|
||||
//
|
||||
// Pass along to our parent, but also create the native widget that we wrap.
|
||||
//
|
||||
NS_IMETHODIMP
|
||||
nsNativeScrollbarFrame::Init(nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aPrevInFlow)
|
||||
{
|
||||
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)) ) {
|
||||
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);
|
||||
|
||||
// defer telling the scrollbar about the mediator and the content
|
||||
// node until its first reflow since not everything has been set
|
||||
// by this point.
|
||||
mScrollbarNeedsContent = PR_TRUE;
|
||||
} else {
|
||||
NS_WARNING("Couldn't create native scrollbar!");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
void
|
||||
nsNativeScrollbarFrame::Destroy()
|
||||
{
|
||||
nsCOMPtr<nsINativeScrollbar> scrollbar(do_QueryInterface(mScrollbar));
|
||||
if (scrollbar) {
|
||||
// frame is going away, unhook the native scrollbar from
|
||||
// the content node just to be safe about lifetime issues
|
||||
scrollbar->SetContent(nsnull, nsnull, nsnull);
|
||||
}
|
||||
|
||||
nsBoxFrame::Destroy();
|
||||
}
|
||||
|
||||
//
|
||||
// FindParts
|
||||
//
|
||||
// Walk up the parent frame tree and find the content node of the frame
|
||||
// with the tag "scrollbar". This is the content node that the GFX Scroll Frame
|
||||
// is watching for attribute changes. We return the associated frame and
|
||||
// any mediator.
|
||||
//
|
||||
nsNativeScrollbarFrame::Parts
|
||||
nsNativeScrollbarFrame::FindParts()
|
||||
{
|
||||
nsIFrame* f;
|
||||
for (f = GetParent(); f; f = f->GetParent()) {
|
||||
nsIContent* currContent = f->GetContent();
|
||||
|
||||
if (currContent && currContent->Tag() == nsGkAtoms::scrollbar) {
|
||||
nsIScrollbarFrame* sb;
|
||||
CallQueryInterface(f, &sb);
|
||||
if (sb)
|
||||
return Parts(f, sb, sb->GetScrollbarMediator());
|
||||
}
|
||||
}
|
||||
|
||||
return Parts(nsnull, nsnull, nsnull);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNativeScrollbarFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
nsresult rv = nsBoxFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// nsGfxScrollFrame may have told us to shrink to nothing. If so, make sure our
|
||||
// desired size agrees.
|
||||
if (aReflowState.availableWidth == 0) {
|
||||
aDesiredSize.width = 0;
|
||||
}
|
||||
if (aReflowState.availableHeight == 0) {
|
||||
aDesiredSize.height = 0;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//
|
||||
// AttributeChanged
|
||||
//
|
||||
// We inherit changes to certain attributes from the parent's content node. These
|
||||
// occur when gecko changes the values of the scrollbar or scrolls the content area
|
||||
// by some means other than our scrollbar (keyboard, scrollwheel, etc). Update
|
||||
// our native scrollbar with the correct values.
|
||||
//
|
||||
NS_IMETHODIMP
|
||||
nsNativeScrollbarFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
||||
nsIAtom* aAttribute,
|
||||
PRInt32 aModType)
|
||||
{
|
||||
nsresult rv = nsBoxFrame::AttributeChanged(aNameSpaceID, aAttribute,
|
||||
aModType);
|
||||
|
||||
if ( aAttribute == nsGkAtoms::curpos ||
|
||||
aAttribute == nsGkAtoms::maxpos ||
|
||||
aAttribute == nsGkAtoms::pageincrement ||
|
||||
aAttribute == nsGkAtoms::increment ) {
|
||||
nsAutoString valueStr;
|
||||
mContent->GetAttr(aNameSpaceID, aAttribute, valueStr);
|
||||
|
||||
PRInt32 error;
|
||||
PRInt32 value = valueStr.ToInteger(&error);
|
||||
if (value < 0)
|
||||
value = 1; // just be safe and sanity check, scrollbar expects unsigned
|
||||
|
||||
nsCOMPtr<nsINativeScrollbar> scrollbar(do_QueryInterface(mScrollbar));
|
||||
if (scrollbar) {
|
||||
if (aAttribute == nsGkAtoms::maxpos) {
|
||||
// bounds check it
|
||||
PRUint32 maxValue = (PRUint32)value;
|
||||
PRUint32 current;
|
||||
scrollbar->GetPosition(¤t);
|
||||
if (current > maxValue)
|
||||
{
|
||||
PRInt32 oldPosition = (PRInt32)current;
|
||||
PRInt32 curPosition = maxValue;
|
||||
|
||||
Parts parts = FindParts();
|
||||
if (parts.mMediator) {
|
||||
parts.mMediator->PositionChanged(parts.mIScrollbarFrame, oldPosition, /* inout */ curPosition);
|
||||
}
|
||||
|
||||
nsAutoString currentStr;
|
||||
currentStr.AppendInt(curPosition);
|
||||
parts.mScrollbarFrame->GetContent()->
|
||||
SetAttr(kNameSpaceID_None, nsGkAtoms::curpos, currentStr, PR_TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
if ( aAttribute == nsGkAtoms::curpos )
|
||||
scrollbar->SetPosition(value);
|
||||
else if ( aAttribute == nsGkAtoms::maxpos )
|
||||
scrollbar->SetMaxRange(value);
|
||||
else if ( aAttribute == nsGkAtoms::pageincrement ) // poorly named, actually the height of the visible view area
|
||||
scrollbar->SetViewSize(value);
|
||||
else if ( aAttribute == nsGkAtoms::increment )
|
||||
scrollbar->SetLineIncrement(value);
|
||||
}
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// GetPrefSize
|
||||
//
|
||||
// Ask our native widget what dimensions it wants to be, convert them
|
||||
// back to twips, and tell gecko.
|
||||
//
|
||||
nsSize
|
||||
nsNativeScrollbarFrame::GetPrefSize(nsBoxLayoutState& aState)
|
||||
{
|
||||
nsSize size(0,0);
|
||||
DISPLAY_PREF_SIZE(this, size);
|
||||
|
||||
PRInt32 narrowDimension = 0;
|
||||
nsCOMPtr<nsINativeScrollbar> native ( do_QueryInterface(mScrollbar) );
|
||||
if ( !native ) return size;
|
||||
native->GetNarrowSize(&narrowDimension);
|
||||
|
||||
if ( IsVertical() )
|
||||
size.width = aState.PresContext()->DevPixelsToAppUnits(narrowDimension);
|
||||
else
|
||||
size.height = aState.PresContext()->DevPixelsToAppUnits(narrowDimension);
|
||||
|
||||
// By now, we have both the content node for the scrollbar and the associated
|
||||
// scrollbar mediator (for outliner, if applicable). Hook up the scrollbar to
|
||||
// gecko
|
||||
Hookup();
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Hookup
|
||||
//
|
||||
// Connect our widget to the content node and/or scrolling mediator. This needs
|
||||
// to be called late enough in the game where everything is ready. Calling it too
|
||||
// early can lead to situations where the mediator hasn't yet been hooked up to the
|
||||
// scrollbar frame
|
||||
//
|
||||
void
|
||||
nsNativeScrollbarFrame::Hookup()
|
||||
{
|
||||
if (!mScrollbarNeedsContent)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsINativeScrollbar> scrollbar(do_QueryInterface(mScrollbar));
|
||||
if (!scrollbar) {
|
||||
NS_WARNING("Native scrollbar widget doesn't implement nsINativeScrollbar");
|
||||
return;
|
||||
}
|
||||
|
||||
Parts parts = FindParts();
|
||||
if (!parts.mScrollbarFrame) {
|
||||
// Nothing to do here
|
||||
return;
|
||||
}
|
||||
|
||||
// We can't just pass 'mediator' to the widget, because 'mediator' might go away.
|
||||
// So pass a pointer to us. When we go away, we can tell the widget.
|
||||
nsIContent* scrollbarContent = parts.mScrollbarFrame->GetContent();
|
||||
scrollbar->SetContent(scrollbarContent,
|
||||
parts.mIScrollbarFrame, parts.mMediator ? this : nsnull);
|
||||
mScrollbarNeedsContent = PR_FALSE;
|
||||
|
||||
if (!scrollbarContent)
|
||||
return;
|
||||
|
||||
// Check to see if the curpos attribute is already present on the content
|
||||
// node. If so, notify the scrollbar.
|
||||
|
||||
nsAutoString value;
|
||||
scrollbarContent->GetAttr(kNameSpaceID_None, nsGkAtoms::curpos, value);
|
||||
|
||||
PRInt32 error;
|
||||
PRUint32 curpos = value.ToInteger(&error);
|
||||
if (!curpos || error)
|
||||
return;
|
||||
|
||||
scrollbar->SetPosition(curpos);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNativeScrollbarFrame::PositionChanged(nsISupports* aScrollbar, PRInt32 aOldIndex, PRInt32& aNewIndex)
|
||||
{
|
||||
Parts parts = FindParts();
|
||||
if (!parts.mMediator)
|
||||
return NS_OK;
|
||||
return parts.mMediator->PositionChanged(aScrollbar, aOldIndex, aNewIndex);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNativeScrollbarFrame::ScrollbarButtonPressed(nsISupports* aScrollbar, PRInt32 aOldIndex, PRInt32 aNewIndex)
|
||||
{
|
||||
Parts parts = FindParts();
|
||||
if (!parts.mMediator)
|
||||
return NS_OK;
|
||||
return parts.mMediator->ScrollbarButtonPressed(aScrollbar, aOldIndex, aNewIndex);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNativeScrollbarFrame::VisibilityChanged(nsISupports* aScrollbar, PRBool aVisible)
|
||||
{
|
||||
Parts parts = FindParts();
|
||||
if (!parts.mMediator)
|
||||
return NS_OK;
|
||||
return parts.mMediator->VisibilityChanged(aScrollbar, aVisible);
|
||||
}
|
|
@ -390,7 +390,7 @@ nsPopupSetFrame::ShowPopup(nsIContent* aElementContent, nsIContent* aPopupConten
|
|||
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
|
||||
|
@ -454,7 +454,7 @@ nsPopupSetFrame::HidePopup(nsIFrame* aPopup)
|
|||
// 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;
|
||||
|
@ -486,7 +486,7 @@ nsPopupSetFrame::DestroyPopup(nsIFrame* aPopup, PRBool aDestroyEntireChain)
|
|||
// 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;
|
||||
|
@ -531,7 +531,7 @@ 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;
|
||||
|
@ -581,7 +581,7 @@ nsPopupSetFrame::OpenPopup(nsPopupFrameList* aEntry, PRBool aActivateFlag)
|
|||
|
||||
if (weakFrame.IsAlive()) {
|
||||
AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
GetPresContext()->PresShell()->FrameNeedsReflow(this, nsIPresShell::eTreeChange);
|
||||
PresContext()->PresShell()->FrameNeedsReflow(this, nsIPresShell::eTreeChange);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -645,7 +645,7 @@ nsPopupSetFrame::OnCreate(PRInt32 aX, PRInt32 aY, nsIContent* aPopupContent)
|
|||
|
||||
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);
|
||||
|
@ -713,7 +713,7 @@ nsPopupSetFrame::OnCreated(PRInt32 aX, PRInt32 aY, nsIContent* aPopupContent)
|
|||
//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);
|
||||
|
@ -733,7 +733,7 @@ nsPopupSetFrame::OnDestroy(nsIContent* aPopupContent)
|
|||
nsMouseEvent::eReal);
|
||||
|
||||
if (aPopupContent) {
|
||||
nsCOMPtr<nsIPresShell> shell = GetPresContext()->GetPresShell();
|
||||
nsCOMPtr<nsIPresShell> shell = PresContext()->GetPresShell();
|
||||
if (shell) {
|
||||
nsresult rv = shell->HandleDOMEventWithTarget(aPopupContent, &event,
|
||||
&status);
|
||||
|
@ -840,7 +840,7 @@ nsPopupSetFrame::AddPopupFrame(nsIFrame* aPopup)
|
|||
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;
|
||||
|
|
|
@ -119,7 +119,7 @@ nsProgressMeterFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
|||
|
||||
if (weakFrame.IsAlive()) {
|
||||
AddStateBits(NS_FRAME_IS_DIRTY);
|
||||
GetPresContext()->PresShell()->
|
||||
PresContext()->PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eTreeChange);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -182,7 +182,7 @@ nsScrollbarFrame::GetScrollbarMediator()
|
|||
if (!mScrollbarMediator)
|
||||
return nsnull;
|
||||
nsIFrame* f =
|
||||
GetPresContext()->PresShell()->GetPrimaryFrameFor(mScrollbarMediator);
|
||||
PresContext()->PresShell()->GetPrimaryFrameFor(mScrollbarMediator);
|
||||
if (!f)
|
||||
return nsnull;
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@ nsSliderFrame::Init(nsIContent* aContent,
|
|||
gSnapMultiplier = nsContentUtils::GetIntPref("slider.snapMultiplier");
|
||||
}
|
||||
|
||||
CreateViewForFrame(GetPresContext(), this, GetStyleContext(), PR_TRUE);
|
||||
CreateViewForFrame(PresContext(), this, GetStyleContext(), PR_TRUE);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -223,7 +223,7 @@ nsSliderFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
|||
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;
|
||||
|
@ -266,7 +266,7 @@ nsSliderFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
|||
aAttribute == nsGkAtoms::increment) {
|
||||
|
||||
AddStateBits(NS_FRAME_IS_DIRTY);
|
||||
GetPresContext()->PresShell()->
|
||||
PresContext()->PresShell()->
|
||||
FrameNeedsReflow(this, nsIPresShell::eStyleChange);
|
||||
}
|
||||
|
||||
|
@ -738,7 +738,7 @@ nsSliderFrame::SetCurrentPosition(nsIContent* scrollbar, nsIFrame* aThumbFrame,
|
|||
mediator->PositionChanged(scrollbarFrame, GetCurrentPosition(scrollbar), newpos);
|
||||
// 'mediator' might be dangling now...
|
||||
UpdateAttribute(scrollbar, newpos, PR_FALSE, aIsSmooth);
|
||||
CurrentPositionChanged(GetPresContext());
|
||||
CurrentPositionChanged(PresContext());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -811,11 +811,11 @@ nsSliderFrame::MouseDown(nsIDOMEvent* aMouseEvent)
|
|||
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
|
||||
|
|
|
@ -298,7 +298,7 @@ nsSplitterFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
|||
// 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) {
|
||||
|
@ -371,7 +371,7 @@ nsSplitterFrame::Init(nsIContent* aContent,
|
|||
}
|
||||
|
||||
mInner->mState = nsSplitterFrameInner::Open;
|
||||
mInner->AddListener(GetPresContext());
|
||||
mInner->AddListener(PresContext());
|
||||
mInner->mParentBox = nsnull;
|
||||
return rv;
|
||||
}
|
||||
|
@ -689,7 +689,7 @@ nsSplitterFrameInner::MouseUp(nsIDOMEvent* aMouseEvent)
|
|||
{
|
||||
mPressed = PR_FALSE;
|
||||
|
||||
mOuter->CaptureMouse(mOuter->GetPresContext(), PR_FALSE);
|
||||
mOuter->CaptureMouse(mOuter->PresContext(), PR_FALSE);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -716,7 +716,7 @@ nsSplitterFrameInner::MouseDown(nsIDOMEvent* aMouseEvent)
|
|||
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);
|
||||
|
||||
|
@ -947,7 +947,7 @@ nsSplitterFrameInner::UpdateState()
|
|||
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) {
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче