Bug 1230863 - Remove unused nsPresContext args from many functions. r=roc.

This commit is contained in:
Nicholas Nethercote 2015-12-06 17:15:53 -08:00
parent 4232de4d67
commit 16cd9db041
45 changed files with 172 additions and 235 deletions

View File

@ -610,16 +610,16 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
case WidgetMouseEvent::eLeftButton: case WidgetMouseEvent::eLeftButton:
BeginTrackingDragGesture(aPresContext, mouseEvent, aTargetFrame); BeginTrackingDragGesture(aPresContext, mouseEvent, aTargetFrame);
mLClickCount = mouseEvent->clickCount; mLClickCount = mouseEvent->clickCount;
SetClickCount(aPresContext, mouseEvent, aStatus); SetClickCount(mouseEvent, aStatus);
sNormalLMouseEventInProcess = true; sNormalLMouseEventInProcess = true;
break; break;
case WidgetMouseEvent::eMiddleButton: case WidgetMouseEvent::eMiddleButton:
mMClickCount = mouseEvent->clickCount; mMClickCount = mouseEvent->clickCount;
SetClickCount(aPresContext, mouseEvent, aStatus); SetClickCount(mouseEvent, aStatus);
break; break;
case WidgetMouseEvent::eRightButton: case WidgetMouseEvent::eRightButton:
mRClickCount = mouseEvent->clickCount; mRClickCount = mouseEvent->clickCount;
SetClickCount(aPresContext, mouseEvent, aStatus); SetClickCount(mouseEvent, aStatus);
break; break;
} }
break; break;
@ -636,7 +636,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
MOZ_FALLTHROUGH; MOZ_FALLTHROUGH;
case WidgetMouseEvent::eRightButton: case WidgetMouseEvent::eRightButton:
case WidgetMouseEvent::eMiddleButton: case WidgetMouseEvent::eMiddleButton:
SetClickCount(aPresContext, mouseEvent, aStatus); SetClickCount(mouseEvent, aStatus);
break; break;
} }
break; break;
@ -3112,7 +3112,7 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
} }
// Make sure to dispatch the click even if there is no frame for // Make sure to dispatch the click even if there is no frame for
// the current target element. This is required for Web compatibility. // the current target element. This is required for Web compatibility.
ret = CheckForAndDispatchClick(presContext, mouseEvent, aStatus); ret = CheckForAndDispatchClick(mouseEvent, aStatus);
} }
nsIPresShell *shell = presContext->GetPresShell(); nsIPresShell *shell = presContext->GetPresShell();
@ -4552,8 +4552,7 @@ EventStateManager::UpdateDragDataTransfer(WidgetDragEvent* dragEvent)
} }
nsresult nsresult
EventStateManager::SetClickCount(nsPresContext* aPresContext, EventStateManager::SetClickCount(WidgetMouseEvent* aEvent,
WidgetMouseEvent* aEvent,
nsEventStatus* aStatus) nsEventStatus* aStatus)
{ {
nsCOMPtr<nsIContent> mouseContent; nsCOMPtr<nsIContent> mouseContent;
@ -4630,8 +4629,7 @@ EventStateManager::SetClickCount(nsPresContext* aPresContext,
} }
nsresult nsresult
EventStateManager::CheckForAndDispatchClick(nsPresContext* aPresContext, EventStateManager::CheckForAndDispatchClick(WidgetMouseEvent* aEvent,
WidgetMouseEvent* aEvent,
nsEventStatus* aStatus) nsEventStatus* aStatus)
{ {
nsresult ret = NS_OK; nsresult ret = NS_OK;

View File

@ -400,11 +400,8 @@ protected:
*/ */
void UpdateDragDataTransfer(WidgetDragEvent* dragEvent); void UpdateDragDataTransfer(WidgetDragEvent* dragEvent);
nsresult SetClickCount(nsPresContext* aPresContext, nsresult SetClickCount(WidgetMouseEvent* aEvent, nsEventStatus* aStatus);
WidgetMouseEvent* aEvent, nsresult CheckForAndDispatchClick(WidgetMouseEvent* aEvent,
nsEventStatus* aStatus);
nsresult CheckForAndDispatchClick(nsPresContext* aPresContext,
WidgetMouseEvent* aEvent,
nsEventStatus* aStatus); nsEventStatus* aStatus);
void EnsureDocument(nsPresContext* aPresContext); void EnsureDocument(nsPresContext* aPresContext);
void FlushPendingEvents(nsPresContext* aPresContext); void FlushPendingEvents(nsPresContext* aPresContext);

View File

@ -2001,8 +2001,8 @@ VerifySameTree(nsStyleContext* aContext1, nsStyleContext* aContext2)
} }
static void static void
VerifyContextParent(nsPresContext* aPresContext, nsIFrame* aFrame, VerifyContextParent(nsIFrame* aFrame, nsStyleContext* aContext,
nsStyleContext* aContext, nsStyleContext* aParentContext) nsStyleContext* aParentContext)
{ {
// get the contexts not provided // get the contexts not provided
if (!aContext) { if (!aContext) {
@ -2062,11 +2062,10 @@ VerifyContextParent(nsPresContext* aPresContext, nsIFrame* aFrame,
} }
static void static void
VerifyStyleTree(nsPresContext* aPresContext, nsIFrame* aFrame, VerifyStyleTree(nsIFrame* aFrame, nsStyleContext* aParentContext)
nsStyleContext* aParentContext)
{ {
nsStyleContext* context = aFrame->StyleContext(); nsStyleContext* context = aFrame->StyleContext();
VerifyContextParent(aPresContext, aFrame, context, nullptr); VerifyContextParent(aFrame, context, nullptr);
nsIFrame::ChildListIterator lists(aFrame); nsIFrame::ChildListIterator lists(aFrame);
for (; !lists.IsDone(); lists.Next()) { for (; !lists.IsDone(); lists.Next()) {
@ -2081,15 +2080,15 @@ VerifyStyleTree(nsPresContext* aPresContext, nsIFrame* aFrame,
// recurse to out of flow frame, letting the parent context get resolved // recurse to out of flow frame, letting the parent context get resolved
do { do {
VerifyStyleTree(aPresContext, outOfFlowFrame, nullptr); VerifyStyleTree(outOfFlowFrame, nullptr);
} while ((outOfFlowFrame = outOfFlowFrame->GetNextContinuation())); } while ((outOfFlowFrame = outOfFlowFrame->GetNextContinuation()));
// verify placeholder using the parent frame's context as // verify placeholder using the parent frame's context as
// parent context // parent context
VerifyContextParent(aPresContext, child, nullptr, nullptr); VerifyContextParent(child, nullptr, nullptr);
} }
else { // regular frame else { // regular frame
VerifyStyleTree(aPresContext, child, nullptr); VerifyStyleTree(child, nullptr);
} }
} }
} }
@ -2100,7 +2099,7 @@ VerifyStyleTree(nsPresContext* aPresContext, nsIFrame* aFrame,
for (nsStyleContext* extraContext; for (nsStyleContext* extraContext;
(extraContext = aFrame->GetAdditionalStyleContext(contextIndex)); (extraContext = aFrame->GetAdditionalStyleContext(contextIndex));
++contextIndex) { ++contextIndex) {
VerifyContextParent(aPresContext, aFrame, extraContext, context); VerifyContextParent(aFrame, extraContext, context);
} }
} }
@ -2110,7 +2109,7 @@ RestyleManager::DebugVerifyStyleTree(nsIFrame* aFrame)
if (aFrame) { if (aFrame) {
nsStyleContext* context = aFrame->StyleContext(); nsStyleContext* context = aFrame->StyleContext();
nsStyleContext* parentContext = context->GetParent(); nsStyleContext* parentContext = context->GetParent();
VerifyStyleTree(mPresContext, aFrame, parentContext); VerifyStyleTree(aFrame, parentContext);
} }
} }
@ -2528,7 +2527,7 @@ RestyleManager::ReparentStyleContext(nsIFrame* aFrame)
} }
} }
#ifdef DEBUG #ifdef DEBUG
VerifyStyleTree(mPresContext, aFrame, newParentContext); VerifyStyleTree(aFrame, newParentContext);
#endif #endif
} }
} }

View File

@ -1427,8 +1427,7 @@ nsFrameConstructorSaveState::~nsFrameConstructorSaveState()
// relevant part of ReparentFrameViewList, I suppose... Or just get rid of // relevant part of ReparentFrameViewList, I suppose... Or just get rid of
// views, which would make most of this function go away. // views, which would make most of this function go away.
static void static void
MoveChildrenTo(nsPresContext* aPresContext, MoveChildrenTo(nsIFrame* aOldParent,
nsIFrame* aOldParent,
nsContainerFrame* aNewParent, nsContainerFrame* aNewParent,
nsFrameList& aFrameList) nsFrameList& aFrameList)
{ {
@ -2815,8 +2814,7 @@ nsCSSFrameConstructor::SetUpDocElementContainingBlock(nsIContent* aDocElement)
// Set the initial child lists // Set the initial child lists
nsContainerFrame* canvasFrame; nsContainerFrame* canvasFrame;
nsContainerFrame* pageFrame = nsContainerFrame* pageFrame =
ConstructPageFrame(mPresShell, presContext, rootFrame, nullptr, ConstructPageFrame(mPresShell, rootFrame, nullptr, canvasFrame);
canvasFrame);
SetInitialSingleChild(rootFrame, pageFrame); SetInitialSingleChild(rootFrame, pageFrame);
// The eventual parent of the document element frame. // The eventual parent of the document element frame.
@ -2857,7 +2855,6 @@ nsCSSFrameConstructor::ConstructAnonymousContentForCanvas(nsFrameConstructorStat
nsContainerFrame* nsContainerFrame*
nsCSSFrameConstructor::ConstructPageFrame(nsIPresShell* aPresShell, nsCSSFrameConstructor::ConstructPageFrame(nsIPresShell* aPresShell,
nsPresContext* aPresContext,
nsContainerFrame* aParentFrame, nsContainerFrame* aParentFrame,
nsIFrame* aPrevPageFrame, nsIFrame* aPrevPageFrame,
nsContainerFrame*& aCanvasFrame) nsContainerFrame*& aCanvasFrame)
@ -6193,7 +6190,7 @@ nsCSSFrameConstructor::AppendFramesToParent(nsFrameConstructorState& aStat
prevBlock = static_cast<nsContainerFrame*>(prevBlock->LastContinuation()); prevBlock = static_cast<nsContainerFrame*>(prevBlock->LastContinuation());
NS_ASSERTION(prevBlock, "Should have previous block here"); NS_ASSERTION(prevBlock, "Should have previous block here");
MoveChildrenTo(aState.mPresContext, aParentFrame, prevBlock, blockKids); MoveChildrenTo(aParentFrame, prevBlock, blockKids);
} }
} }
@ -7125,8 +7122,7 @@ nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer,
if (haveFirstLetterStyle) { if (haveFirstLetterStyle) {
// Before we get going, remove the current letter frames // Before we get going, remove the current letter frames
RemoveLetterFrames(state.mPresContext, state.mPresShell, RemoveLetterFrames(state.mPresShell, containingBlock);
containingBlock);
} }
nsIAtom* frameType = parentFrame->GetType(); nsIAtom* frameType = parentFrame->GetType();
@ -7289,7 +7285,7 @@ bool NotifyListBoxBody(nsPresContext* aPresContext,
return true; return true;
} }
} else { } else {
listBoxBodyFrame->OnContentInserted(aPresContext, aChild); listBoxBodyFrame->OnContentInserted(aChild);
return true; return true;
} }
} }
@ -7621,8 +7617,7 @@ nsCSSFrameConstructor::ContentRangeInserted(nsIContent* aContainer,
} }
// Remove the old letter frames before doing the insertion // Remove the old letter frames before doing the insertion
RemoveLetterFrames(state.mPresContext, mPresShell, RemoveLetterFrames(mPresShell, state.mFloatedItems.containingBlock);
state.mFloatedItems.containingBlock);
// Removing the letterframes messes around with the frame tree, removing // Removing the letterframes messes around with the frame tree, removing
// and creating frames. We need to reget our prevsibling, parent frame, // and creating frames. We need to reget our prevsibling, parent frame,
@ -8113,7 +8108,7 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
// First update the containing blocks structure by removing the // First update the containing blocks structure by removing the
// existing letter frames. This makes the subsequent logic // existing letter frames. This makes the subsequent logic
// simpler. // simpler.
RemoveLetterFrames(presContext, mPresShell, containingBlock); RemoveLetterFrames(mPresShell, containingBlock);
// Recover childFrame and parentFrame // Recover childFrame and parentFrame
childFrame = aChild->GetPrimaryFrame(); childFrame = aChild->GetPrimaryFrame();
@ -8327,8 +8322,7 @@ nsCSSFrameConstructor::CharacterDataChanged(nsIContent* aContent,
// See if the block has first-letter style applied to it. // See if the block has first-letter style applied to it.
haveFirstLetterStyle = HasFirstLetterStyle(block); haveFirstLetterStyle = HasFirstLetterStyle(block);
if (haveFirstLetterStyle) { if (haveFirstLetterStyle) {
RemoveLetterFrames(mPresShell->GetPresContext(), mPresShell, RemoveLetterFrames(mPresShell, block);
block);
// Reget |frame|, since we might have killed it. // Reget |frame|, since we might have killed it.
// Do we really need to call CharacterDataChanged in this case, though? // Do we really need to call CharacterDataChanged in this case, though?
frame = aContent->GetPrimaryFrame(); frame = aContent->GetPrimaryFrame();
@ -8480,7 +8474,6 @@ nsCSSFrameConstructor::CreateContinuingOuterTableFrame(nsIPresShell* aPresSh
nsIFrame* nsIFrame*
nsCSSFrameConstructor::CreateContinuingTableFrame(nsIPresShell* aPresShell, nsCSSFrameConstructor::CreateContinuingTableFrame(nsIPresShell* aPresShell,
nsPresContext* aPresContext,
nsIFrame* aFrame, nsIFrame* aFrame,
nsContainerFrame* aParentFrame, nsContainerFrame* aParentFrame,
nsIContent* aContent, nsIContent* aContent,
@ -8533,7 +8526,7 @@ nsCSSFrameConstructor::CreateContinuingTableFrame(nsIPresShell* aPresShell,
headerFooterFrame->SetRepeatable(true); headerFooterFrame->SetRepeatable(true);
// Table specific initialization // Table specific initialization
headerFooterFrame->InitRepeatedFrame(aPresContext, rowGroupFrame); headerFooterFrame->InitRepeatedFrame(rowGroupFrame);
// XXX Deal with absolute and fixed frames... // XXX Deal with absolute and fixed frames...
childFrames.AddChild(headerFooterFrame); childFrames.AddChild(headerFooterFrame);
@ -8588,8 +8581,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
newFrame->Init(content, aParentFrame, aFrame); newFrame->Init(content, aParentFrame, aFrame);
} else if (nsGkAtoms::pageFrame == frameType) { } else if (nsGkAtoms::pageFrame == frameType) {
nsContainerFrame* canvasFrame; nsContainerFrame* canvasFrame;
newFrame = ConstructPageFrame(shell, aPresContext, aParentFrame, aFrame, newFrame = ConstructPageFrame(shell, aParentFrame, aFrame, canvasFrame);
canvasFrame);
} else if (nsGkAtoms::tableOuterFrame == frameType) { } else if (nsGkAtoms::tableOuterFrame == frameType) {
newFrame = newFrame =
CreateContinuingOuterTableFrame(shell, aPresContext, aFrame, aParentFrame, CreateContinuingOuterTableFrame(shell, aPresContext, aFrame, aParentFrame,
@ -8597,7 +8589,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
} else if (nsGkAtoms::tableFrame == frameType) { } else if (nsGkAtoms::tableFrame == frameType) {
newFrame = newFrame =
CreateContinuingTableFrame(shell, aPresContext, aFrame, aParentFrame, CreateContinuingTableFrame(shell, aFrame, aParentFrame,
content, styleContext); content, styleContext);
} else if (nsGkAtoms::tableRowGroupFrame == frameType) { } else if (nsGkAtoms::tableRowGroupFrame == frameType) {
@ -11030,7 +11022,6 @@ FindFirstLetterFrame(nsIFrame* aFrame, nsIFrame::ChildListID aListID)
nsresult nsresult
nsCSSFrameConstructor::RemoveFloatingFirstLetterFrames( nsCSSFrameConstructor::RemoveFloatingFirstLetterFrames(
nsPresContext* aPresContext,
nsIPresShell* aPresShell, nsIPresShell* aPresShell,
nsIFrame* aBlockFrame, nsIFrame* aBlockFrame,
bool* aStopLooking) bool* aStopLooking)
@ -11121,8 +11112,7 @@ nsCSSFrameConstructor::RemoveFloatingFirstLetterFrames(
} }
nsresult nsresult
nsCSSFrameConstructor::RemoveFirstLetterFrames(nsPresContext* aPresContext, nsCSSFrameConstructor::RemoveFirstLetterFrames(nsIPresShell* aPresShell,
nsIPresShell* aPresShell,
nsContainerFrame* aFrame, nsContainerFrame* aFrame,
nsContainerFrame* aBlockFrame, nsContainerFrame* aBlockFrame,
bool* aStopLooking) bool* aStopLooking)
@ -11184,8 +11174,7 @@ nsCSSFrameConstructor::RemoveFirstLetterFrames(nsPresContext* aPresContext,
nsContainerFrame* kidAsContainerFrame = do_QueryFrame(kid); nsContainerFrame* kidAsContainerFrame = do_QueryFrame(kid);
if (kidAsContainerFrame) { if (kidAsContainerFrame) {
// Look inside child inline frame for the letter frame. // Look inside child inline frame for the letter frame.
RemoveFirstLetterFrames(aPresContext, aPresShell, RemoveFirstLetterFrames(aPresShell, kidAsContainerFrame,
kidAsContainerFrame,
aBlockFrame, aStopLooking); aBlockFrame, aStopLooking);
if (*aStopLooking) { if (*aStopLooking) {
break; break;
@ -11200,8 +11189,7 @@ nsCSSFrameConstructor::RemoveFirstLetterFrames(nsPresContext* aPresContext,
} }
nsresult nsresult
nsCSSFrameConstructor::RemoveLetterFrames(nsPresContext* aPresContext, nsCSSFrameConstructor::RemoveLetterFrames(nsIPresShell* aPresShell,
nsIPresShell* aPresShell,
nsContainerFrame* aBlockFrame) nsContainerFrame* aBlockFrame)
{ {
aBlockFrame = aBlockFrame =
@ -11211,10 +11199,10 @@ nsCSSFrameConstructor::RemoveLetterFrames(nsPresContext* aPresContext,
bool stopLooking = false; bool stopLooking = false;
nsresult rv; nsresult rv;
do { do {
rv = RemoveFloatingFirstLetterFrames(aPresContext, aPresShell, rv = RemoveFloatingFirstLetterFrames(aPresShell,
continuation, &stopLooking); continuation, &stopLooking);
if (NS_SUCCEEDED(rv) && !stopLooking) { if (NS_SUCCEEDED(rv) && !stopLooking) {
rv = RemoveFirstLetterFrames(aPresContext, aPresShell, rv = RemoveFirstLetterFrames(aPresShell,
continuation, aBlockFrame, &stopLooking); continuation, aBlockFrame, &stopLooking);
} }
if (stopLooking) { if (stopLooking) {
@ -11267,8 +11255,7 @@ nsCSSFrameConstructor::RecoverLetterFrames(nsContainerFrame* aBlockFrame)
// listbox Widget Routines // listbox Widget Routines
nsresult nsresult
nsCSSFrameConstructor::CreateListBoxContent(nsPresContext* aPresContext, nsCSSFrameConstructor::CreateListBoxContent(nsContainerFrame* aParentFrame,
nsContainerFrame* aParentFrame,
nsIFrame* aPrevFrame, nsIFrame* aPrevFrame,
nsIContent* aChild, nsIContent* aChild,
nsIFrame** aNewFrame, nsIFrame** aNewFrame,
@ -11586,7 +11573,7 @@ nsCSSFrameConstructor::CreateIBSiblings(nsFrameConstructorState& aState,
FindFirstNonBlock(aChildItems); FindFirstNonBlock(aChildItems);
nsFrameList blockKids = aChildItems.ExtractHead(firstNonBlock); nsFrameList blockKids = aChildItems.ExtractHead(firstNonBlock);
MoveChildrenTo(aState.mPresContext, aInitialInline, blockFrame, blockKids); MoveChildrenTo(aInitialInline, blockFrame, blockKids);
SetFrameIsIBSplit(lastNewInline, blockFrame); SetFrameIsIBSplit(lastNewInline, blockFrame);
aSiblings.AddChild(blockFrame); aSiblings.AddChild(blockFrame);
@ -11606,8 +11593,7 @@ nsCSSFrameConstructor::CreateIBSiblings(nsFrameConstructorState& aState,
FindFirstBlock(firstBlock); FindFirstBlock(firstBlock);
nsFrameList inlineKids = aChildItems.ExtractHead(firstBlock); nsFrameList inlineKids = aChildItems.ExtractHead(firstBlock);
MoveChildrenTo(aState.mPresContext, aInitialInline, inlineFrame, MoveChildrenTo(aInitialInline, inlineFrame, inlineKids);
inlineKids);
} }
SetFrameIsIBSplit(blockFrame, inlineFrame); SetFrameIsIBSplit(blockFrame, inlineFrame);

View File

@ -300,8 +300,7 @@ public:
*/ */
InsertionPoint GetInsertionPoint(nsIContent* aContainer, nsIContent* aChild); InsertionPoint GetInsertionPoint(nsIContent* aContainer, nsIContent* aChild);
nsresult CreateListBoxContent(nsPresContext* aPresContext, nsresult CreateListBoxContent(nsContainerFrame* aParentFrame,
nsContainerFrame* aParentFrame,
nsIFrame* aPrevFrame, nsIFrame* aPrevFrame,
nsIContent* aChild, nsIContent* aChild,
nsIFrame** aResult, nsIFrame** aResult,
@ -336,7 +335,6 @@ private:
class FrameConstructionItemList; class FrameConstructionItemList;
nsContainerFrame* ConstructPageFrame(nsIPresShell* aPresShell, nsContainerFrame* ConstructPageFrame(nsIPresShell* aPresShell,
nsPresContext* aPresContext,
nsContainerFrame* aParentFrame, nsContainerFrame* aParentFrame,
nsIFrame* aPrevPageFrame, nsIFrame* aPrevPageFrame,
nsContainerFrame*& aCanvasFrame); nsContainerFrame*& aCanvasFrame);
@ -1694,7 +1692,6 @@ private:
nsStyleContext* aStyleContext); nsStyleContext* aStyleContext);
nsIFrame* CreateContinuingTableFrame(nsIPresShell* aPresShell, nsIFrame* CreateContinuingTableFrame(nsIPresShell* aPresShell,
nsPresContext* aPresContext,
nsIFrame* aFrame, nsIFrame* aFrame,
nsContainerFrame* aParentFrame, nsContainerFrame* aParentFrame,
nsIContent* aContent, nsIContent* aContent,
@ -1871,20 +1868,17 @@ private:
void RecoverLetterFrames(nsContainerFrame* aBlockFrame); void RecoverLetterFrames(nsContainerFrame* aBlockFrame);
// //
nsresult RemoveLetterFrames(nsPresContext* aPresContext, nsresult RemoveLetterFrames(nsIPresShell* aPresShell,
nsIPresShell* aPresShell,
nsContainerFrame* aBlockFrame); nsContainerFrame* aBlockFrame);
// Recursive helper for RemoveLetterFrames // Recursive helper for RemoveLetterFrames
nsresult RemoveFirstLetterFrames(nsPresContext* aPresContext, nsresult RemoveFirstLetterFrames(nsIPresShell* aPresShell,
nsIPresShell* aPresShell,
nsContainerFrame* aFrame, nsContainerFrame* aFrame,
nsContainerFrame* aBlockFrame, nsContainerFrame* aBlockFrame,
bool* aStopLooking); bool* aStopLooking);
// Special remove method for those pesky floating first-letter frames // Special remove method for those pesky floating first-letter frames
nsresult RemoveFloatingFirstLetterFrames(nsPresContext* aPresContext, nsresult RemoveFloatingFirstLetterFrames(nsIPresShell* aPresShell,
nsIPresShell* aPresShell,
nsIFrame* aBlockFrame, nsIFrame* aBlockFrame,
bool* aStopLooking); bool* aStopLooking);

View File

@ -2746,7 +2746,6 @@ nsDisplayBackgroundImage::ComputeVisibility(nsDisplayListBuilder* aBuilder,
/* static */ nsRegion /* static */ nsRegion
nsDisplayBackgroundImage::GetInsideClipRegion(nsDisplayItem* aItem, nsDisplayBackgroundImage::GetInsideClipRegion(nsDisplayItem* aItem,
nsPresContext* aPresContext,
uint8_t aClip, const nsRect& aRect, uint8_t aClip, const nsRect& aRect,
bool* aSnap) bool* aSnap)
{ {
@ -2802,8 +2801,7 @@ nsDisplayBackgroundImage::GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
(!mFrame->GetPrevContinuation() && !mFrame->GetNextContinuation())) { (!mFrame->GetPrevContinuation() && !mFrame->GetNextContinuation())) {
const nsStyleBackground::Layer& layer = mBackgroundStyle->mLayers[mLayer]; const nsStyleBackground::Layer& layer = mBackgroundStyle->mLayers[mLayer];
if (layer.mImage.IsOpaque() && layer.mBlendMode == NS_STYLE_BLEND_NORMAL) { if (layer.mImage.IsOpaque() && layer.mBlendMode == NS_STYLE_BLEND_NORMAL) {
nsPresContext* presContext = mFrame->PresContext(); result = GetInsideClipRegion(this, layer.mClip, mBounds, aSnap);
result = GetInsideClipRegion(this, presContext, layer.mClip, mBounds, aSnap);
} }
} }
@ -3210,8 +3208,8 @@ nsDisplayBackgroundColor::GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
const nsStyleBackground::Layer& bottomLayer = mBackgroundStyle->BottomLayer(); const nsStyleBackground::Layer& bottomLayer = mBackgroundStyle->BottomLayer();
nsRect borderBox = nsRect(ToReferenceFrame(), mFrame->GetSize()); nsRect borderBox = nsRect(ToReferenceFrame(), mFrame->GetSize());
nsPresContext* presContext = mFrame->PresContext(); return nsDisplayBackgroundImage::GetInsideClipRegion(this, bottomLayer.mClip,
return nsDisplayBackgroundImage::GetInsideClipRegion(this, presContext, bottomLayer.mClip, borderBox, aSnap); borderBox, aSnap);
} }
bool bool

View File

@ -2682,7 +2682,7 @@ public:
virtual void ConfigureLayer(ImageLayer* aLayer, virtual void ConfigureLayer(ImageLayer* aLayer,
const ContainerLayerParameters& aParameters) override; const ContainerLayerParameters& aParameters) override;
static nsRegion GetInsideClipRegion(nsDisplayItem* aItem, nsPresContext* aPresContext, uint8_t aClip, static nsRegion GetInsideClipRegion(nsDisplayItem* aItem, uint8_t aClip,
const nsRect& aRect, bool* aSnap); const nsRect& aRect, bool* aSnap);
virtual bool ShouldFixToViewport(nsDisplayListBuilder* aBuilder) override; virtual bool ShouldFixToViewport(nsDisplayListBuilder* aBuilder) override;

View File

@ -3153,8 +3153,7 @@ nsFrame::SelectByTypeAtPoint(nsPresContext* aPresContext,
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
nsFrame* frame = static_cast<nsFrame*>(theFrame); nsFrame* frame = static_cast<nsFrame*>(theFrame);
return frame->PeekBackwardAndForward(aBeginAmountType, aEndAmountType, return frame->PeekBackwardAndForward(aBeginAmountType, aEndAmountType, offset,
offset, aPresContext,
aBeginAmountType != eSelectWord, aBeginAmountType != eSelectWord,
aSelectFlags); aSelectFlags);
} }
@ -3213,7 +3212,6 @@ nsresult
nsFrame::PeekBackwardAndForward(nsSelectionAmount aAmountBack, nsFrame::PeekBackwardAndForward(nsSelectionAmount aAmountBack,
nsSelectionAmount aAmountForward, nsSelectionAmount aAmountForward,
int32_t aStartPos, int32_t aStartPos,
nsPresContext* aPresContext,
bool aJumpLines, bool aJumpLines,
uint32_t aSelectFlags) uint32_t aSelectFlags)
{ {

View File

@ -394,7 +394,6 @@ public:
nsresult PeekBackwardAndForward(nsSelectionAmount aAmountBack, nsresult PeekBackwardAndForward(nsSelectionAmount aAmountBack,
nsSelectionAmount aAmountForward, nsSelectionAmount aAmountForward,
int32_t aStartPos, int32_t aStartPos,
nsPresContext* aPresContext,
bool aJumpLines, bool aJumpLines,
uint32_t aSelectFlags); uint32_t aSelectFlags);

View File

@ -715,7 +715,7 @@ nsGlyphTableList::GetGlyphTableFor(const nsAString& aFamily)
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
static nsresult static nsresult
InitGlobals(nsPresContext* aPresContext) InitCharGlobals()
{ {
NS_ASSERTION(!gGlyphTableInitialized, "Error -- already initialized"); NS_ASSERTION(!gGlyphTableInitialized, "Error -- already initialized");
gGlyphTableInitialized = true; gGlyphTableInitialized = true;
@ -776,11 +776,10 @@ nsMathMLChar::SetStyleContext(nsStyleContext* aStyleContext)
} }
void void
nsMathMLChar::SetData(nsPresContext* aPresContext, nsMathMLChar::SetData(nsString& aData)
nsString& aData)
{ {
if (!gGlyphTableInitialized) { if (!gGlyphTableInitialized) {
InitGlobals(aPresContext); InitCharGlobals();
} }
mData = aData; mData = aData;
// some assumptions until proven otherwise // some assumptions until proven otherwise
@ -878,7 +877,7 @@ nsMathMLChar::SetData(nsPresContext* aPresContext,
#define NS_MATHML_DELIMITER_SHORTFALL_POINTS 5.0f #define NS_MATHML_DELIMITER_SHORTFALL_POINTS 5.0f
static bool static bool
IsSizeOK(nsPresContext* aPresContext, nscoord a, nscoord b, uint32_t aHint) IsSizeOK(nscoord a, nscoord b, uint32_t aHint)
{ {
// Normal: True if 'a' is around +/-10% of the target 'b' (10% is // Normal: True if 'a' is around +/-10% of the target 'b' (10% is
// 1-DelimiterFactor). This often gives a chance to the base size to // 1-DelimiterFactor). This often gives a chance to the base size to
@ -1243,8 +1242,7 @@ StretchEnumContext::TryVariants(nsGlyphTable* aGlyphTable,
} }
return haveBetter && return haveBetter &&
(largeopOnly || (largeopOnly || IsSizeOK(bestSize, mTargetSize, mStretchHint));
IsSizeOK(mPresContext, bestSize, mTargetSize, mStretchHint));
} }
// 3. Build by parts. // 3. Build by parts.
@ -1415,7 +1413,7 @@ nsMathMLChar::StretchEnumContext::TryParts(nsGlyphTable* aGlyphTable,
mChar->mBmData[i] = bmdata[i]; mChar->mBmData[i] = bmdata[i];
} }
return IsSizeOK(mPresContext, computedSize, mTargetSize, mStretchHint); return IsSizeOK(computedSize, mTargetSize, mStretchHint);
} }
// This is called for each family, whether it exists or not // This is called for each family, whether it exists or not
@ -1640,7 +1638,7 @@ nsMathMLChar::StretchInternal(nsPresContext* aPresContext,
// and not a largeop in display mode; we're done if size fits // and not a largeop in display mode; we're done if size fits
if ((targetSize <= 0) || if ((targetSize <= 0) ||
((isVertical && charSize >= targetSize) || ((isVertical && charSize >= targetSize) ||
IsSizeOK(aPresContext, charSize, targetSize, aStretchHint))) IsSizeOK(charSize, targetSize, aStretchHint)))
done = true; done = true;
} }

View File

@ -123,8 +123,7 @@ public:
bool aRTL); bool aRTL);
void void
SetData(nsPresContext* aPresContext, SetData(nsString& aData);
nsString& aData);
void void
GetData(nsString& aData) { GetData(nsString& aData) {

View File

@ -292,7 +292,7 @@ InitOperators(void)
} }
static nsresult static nsresult
InitGlobals() InitOperatorGlobals()
{ {
gGlobalsInitialized = true; gGlobalsInitialized = true;
nsresult rv = NS_ERROR_OUT_OF_MEMORY; nsresult rv = NS_ERROR_OUT_OF_MEMORY;
@ -348,7 +348,7 @@ nsMathMLOperators::LookupOperator(const nsString& aOperator,
float* aTrailingSpace) float* aTrailingSpace)
{ {
if (!gGlobalsInitialized) { if (!gGlobalsInitialized) {
InitGlobals(); InitOperatorGlobals();
} }
if (gOperatorTable) { if (gOperatorTable) {
NS_ASSERTION(aFlags && aLeadingSpace && aTrailingSpace, "bad usage"); NS_ASSERTION(aFlags && aLeadingSpace && aTrailingSpace, "bad usage");
@ -393,7 +393,7 @@ nsMathMLOperators::LookupOperators(const nsString& aOperator,
float* aTrailingSpace) float* aTrailingSpace)
{ {
if (!gGlobalsInitialized) { if (!gGlobalsInitialized) {
InitGlobals(); InitOperatorGlobals();
} }
aFlags[NS_MATHML_OPERATOR_FORM_INFIX] = 0; aFlags[NS_MATHML_OPERATOR_FORM_INFIX] = 0;

View File

@ -82,7 +82,7 @@ nsresult nsMathMLmencloseFrame::AllocateMathMLChar(nsMencloseNotation mask)
} }
nsPresContext *presContext = PresContext(); nsPresContext *presContext = PresContext();
mMathMLChar[i].SetData(presContext, Char); mMathMLChar[i].SetData(Char);
ResolveMathMLCharStyle(presContext, mContent, mStyleContext, &mMathMLChar[i]); ResolveMathMLCharStyle(presContext, mContent, mStyleContext, &mMathMLChar[i]);
return NS_OK; return NS_OK;

View File

@ -108,7 +108,7 @@ nsMathMLmfencedFrame::CreateFencesAndSeparators(nsPresContext* aPresContext)
if (!value.IsEmpty()) { if (!value.IsEmpty()) {
mOpenChar = new nsMathMLChar; mOpenChar = new nsMathMLChar;
mOpenChar->SetData(aPresContext, value); mOpenChar->SetData(value);
ResolveMathMLCharStyle(aPresContext, mContent, mStyleContext, mOpenChar); ResolveMathMLCharStyle(aPresContext, mContent, mStyleContext, mOpenChar);
} }
@ -122,7 +122,7 @@ nsMathMLmfencedFrame::CreateFencesAndSeparators(nsPresContext* aPresContext)
if (!value.IsEmpty()) { if (!value.IsEmpty()) {
mCloseChar = new nsMathMLChar; mCloseChar = new nsMathMLChar;
mCloseChar->SetData(aPresContext, value); mCloseChar->SetData(value);
ResolveMathMLCharStyle(aPresContext, mContent, mStyleContext, mCloseChar); ResolveMathMLCharStyle(aPresContext, mContent, mStyleContext, mCloseChar);
} }
@ -147,7 +147,7 @@ nsMathMLmfencedFrame::CreateFencesAndSeparators(nsPresContext* aPresContext)
else { else {
sepChar = value[mSeparatorsCount-1]; sepChar = value[mSeparatorsCount-1];
} }
mSeparatorsChar[i].SetData(aPresContext, sepChar); mSeparatorsChar[i].SetData(sepChar);
ResolveMathMLCharStyle(aPresContext, mContent, mStyleContext, &mSeparatorsChar[i]); ResolveMathMLCharStyle(aPresContext, mContent, mStyleContext, &mSeparatorsChar[i]);
} }
mSeparatorsCount = sepCount; mSeparatorsCount = sepCount;

View File

@ -133,7 +133,7 @@ nsMathMLmoFrame::ProcessTextData()
nsPresContext* presContext = PresContext(); nsPresContext* presContext = PresContext();
if (mFrames.GetLength() != 1) { if (mFrames.GetLength() != 1) {
data.Truncate(); // empty data to reset the char data.Truncate(); // empty data to reset the char
mMathMLChar.SetData(presContext, data); mMathMLChar.SetData(data);
ResolveMathMLCharStyle(presContext, mContent, mStyleContext, &mMathMLChar); ResolveMathMLCharStyle(presContext, mContent, mStyleContext, &mMathMLChar);
return; return;
} }
@ -177,7 +177,7 @@ nsMathMLmoFrame::ProcessTextData()
} }
// cache the operator // cache the operator
mMathMLChar.SetData(presContext, data); mMathMLChar.SetData(data);
// cache the native direction -- beware of bug 133429... // cache the native direction -- beware of bug 133429...
// mEmbellishData.direction must always retain our native direction, whereas // mEmbellishData.direction must always retain our native direction, whereas

View File

@ -51,7 +51,7 @@ nsMathMLmrootFrame::Init(nsIContent* aContent,
// The Style System will use Get/SetAdditionalStyleContext() to keep it // The Style System will use Get/SetAdditionalStyleContext() to keep it
// up-to-date if dynamic changes arise. // up-to-date if dynamic changes arise.
nsAutoString sqrChar; sqrChar.Assign(kSqrChar); nsAutoString sqrChar; sqrChar.Assign(kSqrChar);
mSqrChar.SetData(presContext, sqrChar); mSqrChar.SetData(sqrChar);
ResolveMathMLCharStyle(presContext, mContent, mStyleContext, &mSqrChar); ResolveMathMLCharStyle(presContext, mContent, mStyleContext, &mSqrChar);
} }

View File

@ -781,8 +781,7 @@ nsMathMLmtableOuterFrame::AttributeChanged(int32_t aNameSpaceID,
} }
nsIFrame* nsIFrame*
nsMathMLmtableOuterFrame::GetRowFrameAt(nsPresContext* aPresContext, nsMathMLmtableOuterFrame::GetRowFrameAt(int32_t aRowIndex)
int32_t aRowIndex)
{ {
int32_t rowCount = GetRowCount(); int32_t rowCount = GetRowCount();
@ -846,7 +845,7 @@ nsMathMLmtableOuterFrame::Reflow(nsPresContext* aPresContext,
nscoord blockSize = aDesiredSize.BSize(wm); nscoord blockSize = aDesiredSize.BSize(wm);
nsIFrame* rowFrame = nullptr; nsIFrame* rowFrame = nullptr;
if (rowIndex) { if (rowIndex) {
rowFrame = GetRowFrameAt(aPresContext, rowIndex); rowFrame = GetRowFrameAt(rowIndex);
if (rowFrame) { if (rowFrame) {
// translate the coordinates to be relative to us and in our writing mode // translate the coordinates to be relative to us and in our writing mode
nsIFrame* frame = rowFrame; nsIFrame* frame = rowFrame;

View File

@ -53,8 +53,7 @@ protected:
// 1..n means the first row down to the last row, -1..-n means the last row // 1..n means the first row down to the last row, -1..-n means the last row
// up to the first row. Used for alignments that are relative to a given row // up to the first row. Used for alignments that are relative to a given row
nsIFrame* nsIFrame*
GetRowFrameAt(nsPresContext* aPresContext, GetRowFrameAt(int32_t aRowIndex);
int32_t aRowIndex);
}; // class nsMathMLmtableOuterFrame }; // class nsMathMLmtableOuterFrame
// -------------- // --------------

View File

@ -586,8 +586,7 @@ void
AnimationCollection::UpdateCheckGeneration( AnimationCollection::UpdateCheckGeneration(
nsPresContext* aPresContext) nsPresContext* aPresContext)
{ {
mCheckGeneration = mCheckGeneration = aPresContext->RestyleManager()->GetAnimationGeneration();
aPresContext->RestyleManager()->GetAnimationGeneration();
} }
nsPresContext* nsPresContext*

View File

@ -372,7 +372,7 @@ GetWindowsTheme(nsPresContext* aPresContext, const nsMediaFeature* aFeature,
} }
static nsresult static nsresult
GetOperatinSystemVersion(nsPresContext* aPresContext, const nsMediaFeature* aFeature, GetOperatingSystemVersion(nsPresContext* aPresContext, const nsMediaFeature* aFeature,
nsCSSValue& aResult) nsCSSValue& aResult)
{ {
aResult.Reset(); aResult.Reset();
@ -715,7 +715,7 @@ nsMediaFeatures::features[] = {
nsMediaFeature::eIdent, nsMediaFeature::eIdent,
nsMediaFeature::eNoRequirements, nsMediaFeature::eNoRequirements,
{ nullptr }, { nullptr },
GetOperatinSystemVersion GetOperatingSystemVersion
}, },
{ {

View File

@ -825,10 +825,9 @@ void DebugCheckChildSize(nsIFrame* aChild,
// it is the bsize (minus border, padding) of the cell's first in flow during its final // it is the bsize (minus border, padding) of the cell's first in flow during its final
// reflow without an unconstrained bsize. // reflow without an unconstrained bsize.
static nscoord static nscoord
CalcUnpaginatedBSize(nsPresContext* aPresContext, CalcUnpaginatedBSize(nsTableCellFrame& aCellFrame,
nsTableCellFrame& aCellFrame, nsTableFrame& aTableFrame,
nsTableFrame& aTableFrame, nscoord aBlockDirBorderPadding)
nscoord aBlockDirBorderPadding)
{ {
const nsTableCellFrame* firstCellInFlow = const nsTableCellFrame* firstCellInFlow =
static_cast<nsTableCellFrame*>(aCellFrame.FirstInFlow()); static_cast<nsTableCellFrame*>(aCellFrame.FirstInFlow());
@ -852,7 +851,7 @@ CalcUnpaginatedBSize(nsPresContext* aPresContext,
break; break;
} }
else if (rowX >= rowIndex) { else if (rowX >= rowIndex) {
computedBSize += row->GetUnpaginatedBSize(aPresContext); computedBSize += row->GetUnpaginatedBSize();
} }
} }
return computedBSize; return computedBSize;
@ -910,7 +909,7 @@ nsTableCellFrame::Reflow(nsPresContext* aPresContext,
} }
else if (aPresContext->IsPaginated()) { else if (aPresContext->IsPaginated()) {
nscoord computedUnpaginatedBSize = nscoord computedUnpaginatedBSize =
CalcUnpaginatedBSize(aPresContext, (nsTableCellFrame&)*this, CalcUnpaginatedBSize((nsTableCellFrame&)*this,
*tableFrame, borderPadding.BStartEnd(wm)); *tableFrame, borderPadding.BStartEnd(wm));
if (computedUnpaginatedBSize > 0) { if (computedUnpaginatedBSize > 0) {
const_cast<nsHTMLReflowState&>(aReflowState).SetComputedBSize(computedUnpaginatedBSize); const_cast<nsHTMLReflowState&>(aReflowState).SetComputedBSize(computedUnpaginatedBSize);

View File

@ -775,15 +775,14 @@ GetSpaceBetween(int32_t aPrevColIndex,
// subtract the bsizes of aRow's prev in flows from the unpaginated bsize // subtract the bsizes of aRow's prev in flows from the unpaginated bsize
static static
nscoord CalcBSizeFromUnpaginatedBSize(nsPresContext* aPresContext, nscoord CalcBSizeFromUnpaginatedBSize(nsTableRowFrame& aRow,
nsTableRowFrame& aRow,
WritingMode aWM) WritingMode aWM)
{ {
nscoord bsize = 0; nscoord bsize = 0;
nsTableRowFrame* firstInFlow = nsTableRowFrame* firstInFlow =
static_cast<nsTableRowFrame*>(aRow.FirstInFlow()); static_cast<nsTableRowFrame*>(aRow.FirstInFlow());
if (firstInFlow->HasUnpaginatedBSize()) { if (firstInFlow->HasUnpaginatedBSize()) {
bsize = firstInFlow->GetUnpaginatedBSize(aPresContext); bsize = firstInFlow->GetUnpaginatedBSize();
for (nsIFrame* prevInFlow = aRow.GetPrevInFlow(); prevInFlow; for (nsIFrame* prevInFlow = aRow.GetPrevInFlow(); prevInFlow;
prevInFlow = prevInFlow->GetPrevInFlow()) { prevInFlow = prevInFlow->GetPrevInFlow()) {
bsize -= prevInFlow->BSize(aWM); bsize -= prevInFlow->BSize(aWM);
@ -1038,7 +1037,7 @@ nsTableRowFrame::ReflowChildren(nsPresContext* aPresContext,
} else if (NS_UNCONSTRAINEDSIZE == aReflowState.AvailableBSize()) { } else if (NS_UNCONSTRAINEDSIZE == aReflowState.AvailableBSize()) {
aDesiredSize.BSize(wm) = CalcBSize(aReflowState); aDesiredSize.BSize(wm) = CalcBSize(aReflowState);
if (GetPrevInFlow()) { if (GetPrevInFlow()) {
nscoord bsize = CalcBSizeFromUnpaginatedBSize(aPresContext, *this, wm); nscoord bsize = CalcBSizeFromUnpaginatedBSize(*this, wm);
aDesiredSize.BSize(wm) = std::max(aDesiredSize.BSize(wm), bsize); aDesiredSize.BSize(wm) = std::max(aDesiredSize.BSize(wm), bsize);
} else { } else {
if (isPaginated && HasStyleBSize()) { if (isPaginated && HasStyleBSize()) {
@ -1048,14 +1047,13 @@ nsTableRowFrame::ReflowChildren(nsPresContext* aPresContext,
} }
if (isPaginated && HasUnpaginatedBSize()) { if (isPaginated && HasUnpaginatedBSize()) {
aDesiredSize.BSize(wm) = std::max(aDesiredSize.BSize(wm), aDesiredSize.BSize(wm) = std::max(aDesiredSize.BSize(wm),
GetUnpaginatedBSize(aPresContext)); GetUnpaginatedBSize());
} }
} }
} else { // constrained bsize, paginated } else { // constrained bsize, paginated
// Compute the bsize we should have from style (subtracting the // Compute the bsize we should have from style (subtracting the
// bsize from our prev-in-flows from the style bsize) // bsize from our prev-in-flows from the style bsize)
nscoord styleBSize = CalcBSizeFromUnpaginatedBSize(aPresContext, *this, nscoord styleBSize = CalcBSizeFromUnpaginatedBSize(*this, wm);
wm);
if (styleBSize > aReflowState.AvailableBSize()) { if (styleBSize > aReflowState.AvailableBSize()) {
styleBSize = aReflowState.AvailableBSize(); styleBSize = aReflowState.AvailableBSize();
NS_FRAME_SET_INCOMPLETE(aStatus); NS_FRAME_SET_INCOMPLETE(aStatus);
@ -1432,7 +1430,7 @@ nsTableRowFrame::SetUnpaginatedBSize(nsPresContext* aPresContext,
} }
nscoord nscoord
nsTableRowFrame::GetUnpaginatedBSize(nsPresContext* aPresContext) nsTableRowFrame::GetUnpaginatedBSize()
{ {
FrameProperties props = FirstInFlow()->Properties(); FrameProperties props = FirstInFlow()->Properties();
return NS_PTR_TO_INT32(props.Get(RowUnpaginatedHeightProperty())); return NS_PTR_TO_INT32(props.Get(RowUnpaginatedHeightProperty()));

View File

@ -209,7 +209,7 @@ public:
bool HasUnpaginatedBSize(); bool HasUnpaginatedBSize();
void SetHasUnpaginatedBSize(bool aValue); void SetHasUnpaginatedBSize(bool aValue);
nscoord GetUnpaginatedBSize(nsPresContext* aPresContext); nscoord GetUnpaginatedBSize();
void SetUnpaginatedBSize(nsPresContext* aPresContext, nscoord aValue); void SetUnpaginatedBSize(nsPresContext* aPresContext, nscoord aValue);
nscoord GetBStartBCBorderWidth() const { return mBStartBorderWidth; } nscoord GetBStartBCBorderWidth() const { return mBStartBorderWidth; }

View File

@ -92,8 +92,7 @@ void nsTableRowGroupFrame::AdjustRowIndices(int32_t aRowIndex,
} }
} }
nsresult nsresult
nsTableRowGroupFrame::InitRepeatedFrame(nsPresContext* aPresContext, nsTableRowGroupFrame::InitRepeatedFrame(nsTableRowGroupFrame* aHeaderFooterFrame)
nsTableRowGroupFrame* aHeaderFooterFrame)
{ {
nsTableRowFrame* copyRowFrame = GetFirstRow(); nsTableRowFrame* copyRowFrame = GetFirstRow();
nsTableRowFrame* originalRowFrame = aHeaderFooterFrame->GetFirstRow(); nsTableRowFrame* originalRowFrame = aHeaderFooterFrame->GetFirstRow();

View File

@ -155,8 +155,7 @@ public:
* @param aHeaderFooterFrame the original header or footer row group frame * @param aHeaderFooterFrame the original header or footer row group frame
* that was repeated * that was repeated
*/ */
nsresult InitRepeatedFrame(nsPresContext* aPresContext, nsresult InitRepeatedFrame(nsTableRowGroupFrame* aHeaderFooterFrame);
nsTableRowGroupFrame* aHeaderFooterFrame);
/** /**

View File

@ -185,8 +185,9 @@ nsBoxFrame::Init(nsIContent* aContent,
#ifdef DEBUG_LAYOUT #ifdef DEBUG_LAYOUT
// if we are root and this // if we are root and this
if (mState & NS_STATE_IS_ROOT) if (mState & NS_STATE_IS_ROOT) {
GetDebugPref(GetPresContext()); GetDebugPref();
}
#endif #endif
UpdateMouseThrough(); UpdateMouseThrough();
@ -1259,9 +1260,9 @@ nsBoxFrame::AttributeChanged(int32_t aNameSpaceID,
#ifdef DEBUG_LAYOUT #ifdef DEBUG_LAYOUT
void void
nsBoxFrame::GetDebugPref(nsPresContext* aPresContext) nsBoxFrame::GetDebugPref()
{ {
gDebug = Preferences::GetBool("xul.debug.box"); gDebug = Preferences::GetBool("xul.debug.box");
} }
class nsDisplayXULDebug : public nsDisplayItem { class nsDisplayXULDebug : public nsDisplayItem {
@ -1408,13 +1409,13 @@ nsBoxFrame::PaintXULDebugBackground(nsRenderingContext& aRenderingContext,
bool isHorizontal = IsHorizontal(); bool isHorizontal = IsHorizontal();
GetDebugBorder(debugBorder); GetDebugBorder(debugBorder);
PixelMarginToTwips(GetPresContext(), debugBorder); PixelMarginToTwips(debugBorder);
GetDebugMargin(debugMargin); GetDebugMargin(debugMargin);
PixelMarginToTwips(GetPresContext(), debugMargin); PixelMarginToTwips(debugMargin);
GetDebugPadding(debugPadding); GetDebugPadding(debugPadding);
PixelMarginToTwips(GetPresContext(), debugPadding); PixelMarginToTwips(debugPadding);
nsRect inner(mRect); nsRect inner(mRect);
inner.MoveTo(aPt); inner.MoveTo(aPt);
@ -1468,7 +1469,7 @@ nsBoxFrame::PaintXULDebugOverlay(DrawTarget& aDrawTarget, nsPoint aPt)
nsMargin debugMargin; nsMargin debugMargin;
GetDebugMargin(debugMargin); GetDebugMargin(debugMargin);
PixelMarginToTwips(GetPresContext(), debugMargin); PixelMarginToTwips(debugMargin);
nsRect inner(mRect); nsRect inner(mRect);
inner.MoveTo(aPt); inner.MoveTo(aPt);
@ -1671,7 +1672,7 @@ nsBoxFrame::GetDebugPadding(nsMargin& aPadding)
} }
void void
nsBoxFrame::PixelMarginToTwips(nsPresContext* aPresContext, nsMargin& aMarginPixels) nsBoxFrame::PixelMarginToTwips(nsMargin& aMarginPixels)
{ {
nscoord onePixel = nsPresContext::CSSPixelsToAppUnits(1); nscoord onePixel = nsPresContext::CSSPixelsToAppUnits(1);
aMarginPixels.left *= onePixel; aMarginPixels.left *= onePixel;
@ -1742,10 +1743,10 @@ nsBoxFrame::DisplayDebugInfoFor(nsIFrame* aBox,
nsMargin m; nsMargin m;
nsMargin m2; nsMargin m2;
GetDebugBorder(m); GetDebugBorder(m);
PixelMarginToTwips(aPresContext, m); PixelMarginToTwips(m);
GetDebugMargin(m2); GetDebugMargin(m2);
PixelMarginToTwips(aPresContext, m2); PixelMarginToTwips(m2);
m += m2; m += m2;

View File

@ -222,7 +222,7 @@ private:
#ifdef DEBUG_LAYOUT #ifdef DEBUG_LAYOUT
nsresult SetDebug(nsPresContext* aPresContext, bool aDebug); nsresult SetDebug(nsPresContext* aPresContext, bool aDebug);
bool GetInitialDebug(bool& aDebug); bool GetInitialDebug(bool& aDebug);
void GetDebugPref(nsPresContext* aPresContext); void GetDebugPref();
void GetDebugBorder(nsMargin& aInset); void GetDebugBorder(nsMargin& aInset);
void GetDebugPadding(nsMargin& aInset); void GetDebugPadding(nsMargin& aInset);
@ -230,7 +230,7 @@ private:
nsresult GetFrameSizeWithMargin(nsIFrame* aBox, nsSize& aSize); nsresult GetFrameSizeWithMargin(nsIFrame* aBox, nsSize& aSize);
void PixelMarginToTwips(nsPresContext* aPresContext, nsMargin& aMarginPixels); void PixelMarginToTwips(nsMargin& aMarginPixels);
void GetValue(nsPresContext* aPresContext, const nsSize& a, const nsSize& b, char* value); void GetValue(nsPresContext* aPresContext, const nsSize& a, const nsSize& b, char* value);
void GetValue(nsPresContext* aPresContext, int32_t a, int32_t b, char* value); void GetValue(nsPresContext* aPresContext, int32_t a, int32_t b, char* value);

View File

@ -51,7 +51,7 @@ public:
virtual bool GetInitialVAlignment(Valignment& aValign) override { aValign = vAlign_Top; return true; } virtual bool GetInitialVAlignment(Valignment& aValign) override { aValign = vAlign_Top; return true; }
virtual bool GetInitialAutoStretch(bool& aStretch) override { aStretch = true; return true; } virtual bool GetInitialAutoStretch(bool& aStretch) override { aStretch = true; return true; }
nsIFrame* GetCaptionBox(nsPresContext* aPresContext, nsRect& aCaptionRect); nsIFrame* GetCaptionBox(nsRect& aCaptionRect);
}; };
/* /*
@ -172,7 +172,7 @@ nsGroupBoxFrame::PaintBorderBackground(nsRenderingContext& aRenderingContext,
nsPresContext* presContext = PresContext(); nsPresContext* presContext = PresContext();
nsRect groupRect; nsRect groupRect;
nsIFrame* groupBox = GetCaptionBox(presContext, groupRect); nsIFrame* groupBox = GetCaptionBox(groupRect);
if (groupBox) { if (groupBox) {
// if the border is smaller than the legend. Move the border down // if the border is smaller than the legend. Move the border down
@ -253,7 +253,7 @@ nsGroupBoxFrame::PaintBorderBackground(nsRenderingContext& aRenderingContext,
} }
nsIFrame* nsIFrame*
nsGroupBoxFrame::GetCaptionBox(nsPresContext* aPresContext, nsRect& aCaptionRect) nsGroupBoxFrame::GetCaptionBox(nsRect& aCaptionRect)
{ {
// first child is our grouped area // first child is our grouped area
nsIFrame* box = nsBox::GetChildBox(this); nsIFrame* box = nsBox::GetChildBox(this);

View File

@ -1179,7 +1179,7 @@ nsListBoxBodyFrame::GetFirstItemBox(int32_t aOffset, bool* aCreated)
nsPresContext* presContext = PresContext(); nsPresContext* presContext = PresContext();
nsCSSFrameConstructor* fc = presContext->PresShell()->FrameConstructor(); nsCSSFrameConstructor* fc = presContext->PresShell()->FrameConstructor();
nsIFrame* topFrame = nullptr; nsIFrame* topFrame = nullptr;
fc->CreateListBoxContent(presContext, this, nullptr, startContent, fc->CreateListBoxContent(this, nullptr, startContent,
&topFrame, isAppend, false, nullptr); &topFrame, isAppend, false, nullptr);
mTopFrame = topFrame; mTopFrame = topFrame;
if (mTopFrame) { if (mTopFrame) {
@ -1232,7 +1232,7 @@ nsListBoxBodyFrame::GetNextItemBox(nsIFrame* aBox, int32_t aOffset,
nsPresContext* presContext = PresContext(); nsPresContext* presContext = PresContext();
nsCSSFrameConstructor* fc = presContext->PresShell()->FrameConstructor(); nsCSSFrameConstructor* fc = presContext->PresShell()->FrameConstructor();
fc->CreateListBoxContent(presContext, this, prevFrame, nextContent, fc->CreateListBoxContent(this, prevFrame, nextContent,
&result, isAppend, false, nullptr); &result, isAppend, false, nullptr);
if (result) { if (result) {
@ -1339,8 +1339,8 @@ nsListBoxBodyFrame::ListBoxInsertFrames(nsIFrame* aPrevFrame,
// //
// Called by nsCSSFrameConstructor when a new listitem content is inserted. // Called by nsCSSFrameConstructor when a new listitem content is inserted.
// //
void void
nsListBoxBodyFrame::OnContentInserted(nsPresContext* aPresContext, nsIContent* aChildContent) nsListBoxBodyFrame::OnContentInserted(nsIContent* aChildContent)
{ {
if (mRowCount >= 0) if (mRowCount >= 0)
++mRowCount; ++mRowCount;

View File

@ -122,7 +122,7 @@ public:
bool ContinueReflow(nscoord height); bool ContinueReflow(nscoord height);
NS_IMETHOD ListBoxAppendFrames(nsFrameList& aFrameList); NS_IMETHOD ListBoxAppendFrames(nsFrameList& aFrameList);
NS_IMETHOD ListBoxInsertFrames(nsIFrame* aPrevFrame, nsFrameList& aFrameList); NS_IMETHOD ListBoxInsertFrames(nsIFrame* aPrevFrame, nsFrameList& aFrameList);
void OnContentInserted(nsPresContext* aPresContext, nsIContent* aContent); void OnContentInserted(nsIContent* aContent);
void OnContentRemoved(nsPresContext* aPresContext, nsIContent* aContainer, void OnContentRemoved(nsPresContext* aPresContext, nsIContent* aContainer,
nsIFrame* aChildFrame, nsIContent* aOldNextSibling); nsIFrame* aChildFrame, nsIContent* aOldNextSibling);

View File

@ -190,7 +190,7 @@ nsMenuBarFrame::FindMenuWithShortcut(nsIDOMKeyEvent* aKeyEvent)
nsIContent* current = currFrame->GetContent(); nsIContent* current = currFrame->GetContent();
// See if it's a menu item. // See if it's a menu item.
if (nsXULPopupManager::IsValidMenuItem(PresContext(), current, false)) { if (nsXULPopupManager::IsValidMenuItem(current, false)) {
// Get the shortcut attribute. // Get the shortcut attribute.
nsAutoString shortcutKey; nsAutoString shortcutKey;
current->GetAttr(kNameSpaceID_None, nsGkAtoms::accesskey, shortcutKey); current->GetAttr(kNameSpaceID_None, nsGkAtoms::accesskey, shortcutKey);

View File

@ -125,7 +125,7 @@ public:
nsMenuFrame* frame = static_cast<nsMenuFrame*>(mFrame.GetFrame()); nsMenuFrame* frame = static_cast<nsMenuFrame*>(mFrame.GetFrame());
NS_ENSURE_STATE(frame); NS_ENSURE_STATE(frame);
if (mAttr == nsGkAtoms::checked) { if (mAttr == nsGkAtoms::checked) {
frame->UpdateMenuSpecialState(frame->PresContext()); frame->UpdateMenuSpecialState();
} else if (mAttr == nsGkAtoms::acceltext) { } else if (mAttr == nsGkAtoms::acceltext) {
// someone reset the accelText attribute, // someone reset the accelText attribute,
// so clear the bit that says *we* set it // so clear the bit that says *we* set it
@ -135,7 +135,7 @@ public:
else if (mAttr == nsGkAtoms::key) { else if (mAttr == nsGkAtoms::key) {
frame->BuildAcceleratorText(true); frame->BuildAcceleratorText(true);
} else if (mAttr == nsGkAtoms::type || mAttr == nsGkAtoms::name) { } else if (mAttr == nsGkAtoms::type || mAttr == nsGkAtoms::name) {
frame->UpdateMenuType(frame->PresContext()); frame->UpdateMenuType();
} }
return NS_OK; return NS_OK;
} }
@ -211,7 +211,7 @@ public:
bool shouldFlush = false; bool shouldFlush = false;
nsMenuFrame* menu = do_QueryFrame(mWeakFrame.GetFrame()); nsMenuFrame* menu = do_QueryFrame(mWeakFrame.GetFrame());
if (menu) { if (menu) {
menu->UpdateMenuType(menu->PresContext()); menu->UpdateMenuType();
shouldFlush = true; shouldFlush = true;
} }
delete this; delete this;
@ -913,7 +913,7 @@ nsMenuFrame::IsDisabled()
} }
void void
nsMenuFrame::UpdateMenuType(nsPresContext* aPresContext) nsMenuFrame::UpdateMenuType()
{ {
static nsIContent::AttrValuesArray strings[] = static nsIContent::AttrValuesArray strings[] =
{&nsGkAtoms::checkbox, &nsGkAtoms::radio, nullptr}; {&nsGkAtoms::checkbox, &nsGkAtoms::radio, nullptr};
@ -935,12 +935,12 @@ nsMenuFrame::UpdateMenuType(nsPresContext* aPresContext)
mType = eMenuType_Normal; mType = eMenuType_Normal;
break; break;
} }
UpdateMenuSpecialState(aPresContext); UpdateMenuSpecialState();
} }
/* update checked-ness for type="checkbox" and type="radio" */ /* update checked-ness for type="checkbox" and type="radio" */
void void
nsMenuFrame::UpdateMenuSpecialState(nsPresContext* aPresContext) nsMenuFrame::UpdateMenuSpecialState()
{ {
bool newChecked = bool newChecked =
mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::checked, mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::checked,

View File

@ -235,10 +235,10 @@ protected:
// Update the menu's type (normal, checkbox, radio). // Update the menu's type (normal, checkbox, radio).
// This method can destroy the frame. // This method can destroy the frame.
void UpdateMenuType(nsPresContext* aPresContext); void UpdateMenuType();
// Update the checked state of the menu, and for radios, clear any other // Update the checked state of the menu, and for radios, clear any other
// checked items. This method can destroy the frame. // checked items. This method can destroy the frame.
void UpdateMenuSpecialState(nsPresContext* aPresContext); void UpdateMenuSpecialState();
// Examines the key node and builds the accelerator. // Examines the key node and builds the accelerator.
void BuildAcceleratorText(bool aNotify); void BuildAcceleratorText(bool aNotify);

View File

@ -1747,7 +1747,7 @@ void nsMenuPopupFrame::ChangeByPage(bool aIsUp)
// Only consider menu frames. // Only consider menu frames.
nsMenuFrame* menuFrame = do_QueryFrame(currentMenu); nsMenuFrame* menuFrame = do_QueryFrame(currentMenu);
if (menuFrame && if (menuFrame &&
nsXULPopupManager::IsValidMenuItem(PresContext(), menuFrame->GetContent(), true)) { nsXULPopupManager::IsValidMenuItem(menuFrame->GetContent(), true)) {
// If the right position was found, break out. Otherwise, look for another item. // If the right position was found, break out. Otherwise, look for another item.
if ((!aIsUp && currentMenu->GetRect().YMost() > targetPosition) || if ((!aIsUp && currentMenu->GetRect().YMost() > targetPosition) ||

View File

@ -230,8 +230,7 @@ nsScrollbarButtonFrame::MouseClicked(nsPresContext* aPresContext,
} }
nsresult nsresult
nsScrollbarButtonFrame::GetChildWithTag(nsPresContext* aPresContext, nsScrollbarButtonFrame::GetChildWithTag(nsIAtom* atom, nsIFrame* start,
nsIAtom* atom, nsIFrame* start,
nsIFrame*& result) nsIFrame*& result)
{ {
// recursively search our children // recursively search our children
@ -252,7 +251,7 @@ nsScrollbarButtonFrame::GetChildWithTag(nsPresContext* aPresContext,
} }
// recursive search the child // recursive search the child
GetChildWithTag(aPresContext, atom, childFrame, result); GetChildWithTag(atom, childFrame, result);
if (result != nullptr) if (result != nullptr)
return NS_OK; return NS_OK;

View File

@ -35,8 +35,7 @@ public:
mozilla::WidgetGUIEvent* aEvent, mozilla::WidgetGUIEvent* aEvent,
nsEventStatus* aEventStatus) override; nsEventStatus* aEventStatus) override;
static nsresult GetChildWithTag(nsPresContext* aPresContext, static nsresult GetChildWithTag(nsIAtom* atom, nsIFrame* start, nsIFrame*& result);
nsIAtom* atom, nsIFrame* start, nsIFrame*& result);
static nsresult GetParentWithTag(nsIAtom* atom, nsIFrame* start, nsIFrame*& result); static nsresult GetParentWithTag(nsIAtom* atom, nsIFrame* start, nsIFrame*& result);
bool HandleButtonPress(nsPresContext* aPresContext, bool HandleButtonPress(nsPresContext* aPresContext,

View File

@ -84,17 +84,16 @@ public:
int32_t aCount, int32_t aCount,
int32_t& aSpaceLeft); int32_t& aSpaceLeft);
void ResizeChildTo(nsPresContext* aPresContext, void ResizeChildTo(nscoord& aDiff,
nscoord& aDiff, nsSplitterInfo* aChildrenBeforeInfos,
nsSplitterInfo* aChildrenBeforeInfos, nsSplitterInfo* aChildrenAfterInfos,
nsSplitterInfo* aChildrenAfterInfos, int32_t aChildrenBeforeCount,
int32_t aChildrenBeforeCount, int32_t aChildrenAfterCount,
int32_t aChildrenAfterCount, bool aBounded);
bool aBounded);
void UpdateState(); void UpdateState();
void AddListener(nsPresContext* aPresContext); void AddListener();
void RemoveListener(); void RemoveListener();
enum ResizeType { Closest, Farthest, Flex, Grow }; enum ResizeType { Closest, Farthest, Flex, Grow };
@ -249,7 +248,7 @@ nsSplitterFrame::AttributeChanged(int32_t aNameSpaceID,
// tell the slider its attribute changed so it can // tell the slider its attribute changed so it can
// update itself // update itself
nsIFrame* grippy = nullptr; nsIFrame* grippy = nullptr;
nsScrollbarButtonFrame::GetChildWithTag(PresContext(), nsGkAtoms::grippy, this, grippy); nsScrollbarButtonFrame::GetChildWithTag(nsGkAtoms::grippy, this, grippy);
if (grippy) if (grippy)
grippy->AttributeChanged(aNameSpaceID, aAttribute, aModType); grippy->AttributeChanged(aNameSpaceID, aAttribute, aModType);
} else if (aAttribute == nsGkAtoms::state) { } else if (aAttribute == nsGkAtoms::state) {
@ -295,7 +294,7 @@ nsSplitterFrame::Init(nsIContent* aContent,
nsBoxFrame::Init(aContent, aParent, aPrevInFlow); nsBoxFrame::Init(aContent, aParent, aPrevInFlow);
mInner->mState = nsSplitterFrameInner::Open; mInner->mState = nsSplitterFrameInner::Open;
mInner->AddListener(PresContext()); mInner->AddListener();
mInner->mParentBox = nullptr; mInner->mParentBox = nullptr;
} }
@ -410,7 +409,7 @@ nsSplitterFrameInner::MouseUp(nsPresContext* aPresContext,
{ {
if (mDragging && mOuter) { if (mDragging && mOuter) {
AdjustChildren(aPresContext); AdjustChildren(aPresContext);
AddListener(aPresContext); AddListener();
nsIPresShell::SetCapturingContent(nullptr, 0); // XXXndeakin is this needed? nsIPresShell::SetCapturingContent(nullptr, 0); // XXXndeakin is this needed?
mDragging = false; mDragging = false;
State newState = GetState(); State newState = GetState();
@ -475,7 +474,7 @@ nsSplitterFrameInner::MouseDrag(nsPresContext* aPresContext,
nscoord oldPos = pos; nscoord oldPos = pos;
ResizeChildTo(aPresContext, pos, ResizeChildTo(pos,
mChildInfosBefore.get(), mChildInfosAfter.get(), mChildInfosBefore.get(), mChildInfosAfter.get(),
mChildInfosBeforeCount, mChildInfosAfterCount, bounded); mChildInfosBeforeCount, mChildInfosAfterCount, bounded);
@ -542,7 +541,7 @@ nsSplitterFrameInner::MouseDrag(nsPresContext* aPresContext,
} }
void void
nsSplitterFrameInner::AddListener(nsPresContext* aPresContext) nsSplitterFrameInner::AddListener()
{ {
mOuter->GetContent()-> mOuter->GetContent()->
AddEventListener(NS_LITERAL_STRING("mouseup"), this, false, false); AddEventListener(NS_LITERAL_STRING("mouseup"), this, false, false);
@ -1023,14 +1022,13 @@ nsSplitterFrameInner::AddRemoveSpace(nscoord aDiff,
*/ */
void void
nsSplitterFrameInner::ResizeChildTo(nsPresContext* aPresContext, nsSplitterFrameInner::ResizeChildTo(nscoord& aDiff,
nscoord& aDiff, nsSplitterInfo* aChildrenBeforeInfos,
nsSplitterInfo* aChildrenBeforeInfos, nsSplitterInfo* aChildrenAfterInfos,
nsSplitterInfo* aChildrenAfterInfos, int32_t aChildrenBeforeCount,
int32_t aChildrenBeforeCount, int32_t aChildrenAfterCount,
int32_t aChildrenAfterCount, bool aBounded)
bool aBounded) {
{
nscoord spaceLeft; nscoord spaceLeft;
AddRemoveSpace(aDiff, aChildrenBeforeInfos,aChildrenBeforeCount,spaceLeft); AddRemoveSpace(aDiff, aChildrenBeforeInfos,aChildrenBeforeCount,spaceLeft);

View File

@ -620,8 +620,7 @@ nsTextBoxFrame::CalculateUnderline(nsRenderingContext& aRenderingContext,
} }
nscoord nscoord
nsTextBoxFrame::CalculateTitleForWidth(nsPresContext* aPresContext, nsTextBoxFrame::CalculateTitleForWidth(nsRenderingContext& aRenderingContext,
nsRenderingContext& aRenderingContext,
nscoord aWidth) nscoord aWidth)
{ {
if (mTitle.IsEmpty()) { if (mTitle.IsEmpty()) {
@ -1016,8 +1015,7 @@ nsTextBoxFrame::MarkIntrinsicISizesDirty()
} }
void void
nsTextBoxFrame::GetTextSize(nsPresContext* aPresContext, nsTextBoxFrame::GetTextSize(nsRenderingContext& aRenderingContext,
nsRenderingContext& aRenderingContext,
const nsString& aString, const nsString& aString,
nsSize& aSize, nscoord& aAscent) nsSize& aSize, nscoord& aAscent)
{ {
@ -1033,14 +1031,11 @@ nsTextBoxFrame::GetTextSize(nsPresContext* aPresContext,
void void
nsTextBoxFrame::CalcTextSize(nsBoxLayoutState& aBoxLayoutState) nsTextBoxFrame::CalcTextSize(nsBoxLayoutState& aBoxLayoutState)
{ {
if (mNeedsRecalc) if (mNeedsRecalc) {
{
nsSize size; nsSize size;
nsPresContext* presContext = aBoxLayoutState.PresContext();
nsRenderingContext* rendContext = aBoxLayoutState.GetRenderingContext(); nsRenderingContext* rendContext = aBoxLayoutState.GetRenderingContext();
if (rendContext) { if (rendContext) {
GetTextSize(presContext, *rendContext, GetTextSize(*rendContext, mTitle, size, mAscent);
mTitle, size, mAscent);
if (GetWritingMode().IsVertical()) { if (GetWritingMode().IsVertical()) {
Swap(size.width, size.height); Swap(size.width, size.height);
} }
@ -1061,13 +1056,11 @@ nsTextBoxFrame::CalcDrawRect(nsRenderingContext &aRenderingContext)
textRect.Deflate(wm, LogicalMargin(wm, borderPadding)); textRect.Deflate(wm, LogicalMargin(wm, borderPadding));
// determine (cropped) title and underline position // determine (cropped) title and underline position
nsPresContext* presContext = PresContext();
// determine (cropped) title which fits in aRect, and its width // determine (cropped) title which fits in aRect, and its width
// (where "width" is the text measure along its baseline, i.e. actually // (where "width" is the text measure along its baseline, i.e. actually
// a physical height in vertical writing modes) // a physical height in vertical writing modes)
nscoord titleWidth = nscoord titleWidth =
CalculateTitleForWidth(presContext, aRenderingContext, CalculateTitleForWidth(aRenderingContext, textRect.ISize(wm));
textRect.ISize(wm));
#ifdef ACCESSIBILITY #ifdef ACCESSIBILITY
// Make sure to update the accessible tree in case when cropped title is // Make sure to update the accessible tree in case when cropped title is

View File

@ -94,12 +94,10 @@ protected:
explicit nsTextBoxFrame(nsStyleContext* aContext); explicit nsTextBoxFrame(nsStyleContext* aContext);
nscoord CalculateTitleForWidth(nsPresContext* aPresContext, nscoord CalculateTitleForWidth(nsRenderingContext& aRenderingContext,
nsRenderingContext& aRenderingContext,
nscoord aWidth); nscoord aWidth);
void GetTextSize(nsPresContext* aPresContext, void GetTextSize(nsRenderingContext& aRenderingContext,
nsRenderingContext& aRenderingContext,
const nsString& aString, const nsString& aString,
nsSize& aSize, nsSize& aSize,
nscoord& aAscent); nscoord& aAscent);

View File

@ -2320,7 +2320,7 @@ nsXULPopupManager::GetNextMenuItem(nsContainerFrame* aParent,
while (currFrame) { while (currFrame) {
// See if it's a menu item. // See if it's a menu item.
nsIContent* currFrameContent = currFrame->GetContent(); nsIContent* currFrameContent = currFrame->GetContent();
if (IsValidMenuItem(presContext, currFrameContent, aIsPopup)) { if (IsValidMenuItem(currFrameContent, aIsPopup)) {
return do_QueryFrame(currFrame); return do_QueryFrame(currFrame);
} }
if (currFrameContent->IsXULElement(nsGkAtoms::menugroup) && if (currFrameContent->IsXULElement(nsGkAtoms::menugroup) &&
@ -2339,7 +2339,7 @@ nsXULPopupManager::GetNextMenuItem(nsContainerFrame* aParent,
while (currFrame && currFrame != aStart) { while (currFrame && currFrame != aStart) {
// See if it's a menu item. // See if it's a menu item.
nsIContent* currFrameContent = currFrame->GetContent(); nsIContent* currFrameContent = currFrame->GetContent();
if (IsValidMenuItem(presContext, currFrameContent, aIsPopup)) { if (IsValidMenuItem(currFrameContent, aIsPopup)) {
return do_QueryFrame(currFrame); return do_QueryFrame(currFrame);
} }
if (currFrameContent->IsXULElement(nsGkAtoms::menugroup) && if (currFrameContent->IsXULElement(nsGkAtoms::menugroup) &&
@ -2383,7 +2383,7 @@ nsXULPopupManager::GetPreviousMenuItem(nsContainerFrame* aParent,
while (currFrame) { while (currFrame) {
// See if it's a menu item. // See if it's a menu item.
nsIContent* currFrameContent = currFrame->GetContent(); nsIContent* currFrameContent = currFrame->GetContent();
if (IsValidMenuItem(presContext, currFrameContent, aIsPopup)) { if (IsValidMenuItem(currFrameContent, aIsPopup)) {
return do_QueryFrame(currFrame); return do_QueryFrame(currFrame);
} }
if (currFrameContent->IsXULElement(nsGkAtoms::menugroup) && if (currFrameContent->IsXULElement(nsGkAtoms::menugroup) &&
@ -2404,7 +2404,7 @@ nsXULPopupManager::GetPreviousMenuItem(nsContainerFrame* aParent,
while (currFrame && currFrame != aStart) { while (currFrame && currFrame != aStart) {
// See if it's a menu item. // See if it's a menu item.
nsIContent* currFrameContent = currFrame->GetContent(); nsIContent* currFrameContent = currFrame->GetContent();
if (IsValidMenuItem(presContext, currFrameContent, aIsPopup)) { if (IsValidMenuItem(currFrameContent, aIsPopup)) {
return do_QueryFrame(currFrame); return do_QueryFrame(currFrame);
} }
if (currFrameContent->IsXULElement(nsGkAtoms::menugroup) && if (currFrameContent->IsXULElement(nsGkAtoms::menugroup) &&
@ -2424,9 +2424,7 @@ nsXULPopupManager::GetPreviousMenuItem(nsContainerFrame* aParent,
} }
bool bool
nsXULPopupManager::IsValidMenuItem(nsPresContext* aPresContext, nsXULPopupManager::IsValidMenuItem(nsIContent* aContent, bool aOnPopup)
nsIContent* aContent,
bool aOnPopup)
{ {
if (aContent->IsXULElement()) { if (aContent->IsXULElement()) {
if (!aContent->IsAnyOfXULElements(nsGkAtoms::menu, nsGkAtoms::menuitem)) { if (!aContent->IsAnyOfXULElements(nsGkAtoms::menu, nsGkAtoms::menuitem)) {

View File

@ -348,9 +348,7 @@ public:
// returns true if the menu item aContent is a valid menuitem which may // returns true if the menu item aContent is a valid menuitem which may
// be navigated to. aIsPopup should be true for items on a popup, or false // be navigated to. aIsPopup should be true for items on a popup, or false
// for items on a menubar. // for items on a menubar.
static bool IsValidMenuItem(nsPresContext* aPresContext, static bool IsValidMenuItem(nsIContent* aContent, bool aOnPopup);
nsIContent* aContent,
bool aOnPopup);
// inform the popup manager that a menu bar has been activated or deactivated, // inform the popup manager that a menu bar has been activated or deactivated,
// either because one of its menus has opened or closed, or that the menubar // either because one of its menus has opened or closed, or that the menubar

View File

@ -596,14 +596,14 @@ nsBaseDragService::DrawDrag(nsIDOMNode* aDOMNode,
nsCOMPtr<nsIContent> content = do_QueryInterface(dragNode); nsCOMPtr<nsIContent> content = do_QueryInterface(dragNode);
HTMLCanvasElement *canvas = HTMLCanvasElement::FromContentOrNull(content); HTMLCanvasElement *canvas = HTMLCanvasElement::FromContentOrNull(content);
if (canvas) { if (canvas) {
return DrawDragForImage(*aPresContext, nullptr, canvas, sx, sy, return DrawDragForImage(nullptr, canvas, sx, sy,
aScreenDragRect, aSurface); aScreenDragRect, aSurface);
} }
nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(dragNode); nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(dragNode);
// for image nodes, create the drag image from the actual image data // for image nodes, create the drag image from the actual image data
if (imageLoader) { if (imageLoader) {
return DrawDragForImage(*aPresContext, imageLoader, nullptr, sx, sy, return DrawDragForImage(imageLoader, nullptr, sx, sy,
aScreenDragRect, aSurface); aScreenDragRect, aSurface);
} }
@ -642,8 +642,7 @@ nsBaseDragService::DrawDrag(nsIDOMNode* aDOMNode,
} }
nsresult nsresult
nsBaseDragService::DrawDragForImage(nsPresContext* aPresContext, nsBaseDragService::DrawDragForImage(nsIImageLoadingContent* aImageLoader,
nsIImageLoadingContent* aImageLoader,
HTMLCanvasElement* aCanvas, HTMLCanvasElement* aCanvas,
int32_t aScreenX, int32_t aScreenY, int32_t aScreenX, int32_t aScreenY,
nsIntRect* aScreenDragRect, nsIntRect* aScreenDragRect,

View File

@ -112,8 +112,7 @@ protected:
* Draw a drag image for an image node specified by aImageLoader or aCanvas. * Draw a drag image for an image node specified by aImageLoader or aCanvas.
* This is called by DrawDrag. * This is called by DrawDrag.
*/ */
nsresult DrawDragForImage(nsPresContext* aPresContext, nsresult DrawDragForImage(nsIImageLoadingContent* aImageLoader,
nsIImageLoadingContent* aImageLoader,
mozilla::dom::HTMLCanvasElement* aCanvas, mozilla::dom::HTMLCanvasElement* aCanvas,
int32_t aScreenX, int32_t aScreenY, int32_t aScreenX, int32_t aScreenY,
nsIntRect* aScreenDragRect, nsIntRect* aScreenDragRect,

View File

@ -2258,9 +2258,9 @@ nsNativeThemeWin::GetMinimumWidgetSize(nsPresContext* aPresContext, nsIFrame* aF
*aIsOverridable = true; *aIsOverridable = true;
HANDLE theme = GetTheme(aWidgetType); HANDLE theme = GetTheme(aWidgetType);
if (!theme) if (!theme) {
return ClassicGetMinimumWidgetSize(aPresContext, aFrame, aWidgetType, aResult, aIsOverridable); return ClassicGetMinimumWidgetSize(aFrame, aWidgetType, aResult, aIsOverridable);
}
switch (aWidgetType) { switch (aWidgetType) {
case NS_THEME_GROUPBOX: case NS_THEME_GROUPBOX:
case NS_THEME_NUMBER_INPUT: case NS_THEME_NUMBER_INPUT:
@ -2300,7 +2300,7 @@ nsNativeThemeWin::GetMinimumWidgetSize(nsPresContext* aPresContext, nsIFrame* aF
case NS_THEME_SCROLLBAR_TRACK_HORIZONTAL: case NS_THEME_SCROLLBAR_TRACK_HORIZONTAL:
case NS_THEME_SCROLLBAR_TRACK_VERTICAL: case NS_THEME_SCROLLBAR_TRACK_VERTICAL:
case NS_THEME_DROPDOWN_BUTTON: case NS_THEME_DROPDOWN_BUTTON:
return ClassicGetMinimumWidgetSize(aPresContext, aFrame, aWidgetType, aResult, aIsOverridable); return ClassicGetMinimumWidgetSize(aFrame, aWidgetType, aResult, aIsOverridable);
case NS_THEME_MENUITEM: case NS_THEME_MENUITEM:
case NS_THEME_CHECKMENUITEM: case NS_THEME_CHECKMENUITEM:
@ -2611,14 +2611,14 @@ nsNativeThemeWin::ThemeSupportsWidget(nsPresContext* aPresContext,
theme = GetTheme(NS_THEME_RADIO); theme = GetTheme(NS_THEME_RADIO);
else else
theme = GetTheme(aWidgetType); theme = GetTheme(aWidgetType);
if (theme && aWidgetType == NS_THEME_RESIZER) if (theme && aWidgetType == NS_THEME_RESIZER)
return true; return true;
if ((theme) || (!theme && ClassicThemeSupportsWidget(aPresContext, aFrame, aWidgetType))) if ((theme) || (!theme && ClassicThemeSupportsWidget(aFrame, aWidgetType)))
// turn off theming for some HTML widgets styled by the page // turn off theming for some HTML widgets styled by the page
return (!IsWidgetStyled(aPresContext, aFrame, aWidgetType)); return (!IsWidgetStyled(aPresContext, aFrame, aWidgetType));
return false; return false;
} }
@ -2735,10 +2735,9 @@ nsNativeThemeWin::GetWidgetTransparency(nsIFrame* aFrame, uint8_t aWidgetType)
/* Windows 9x/NT/2000/Classic XP Theme Support */ /* Windows 9x/NT/2000/Classic XP Theme Support */
bool bool
nsNativeThemeWin::ClassicThemeSupportsWidget(nsPresContext* aPresContext, nsNativeThemeWin::ClassicThemeSupportsWidget(nsIFrame* aFrame,
nsIFrame* aFrame, uint8_t aWidgetType)
uint8_t aWidgetType)
{ {
switch (aWidgetType) { switch (aWidgetType) {
case NS_THEME_RESIZER: case NS_THEME_RESIZER:
@ -2914,9 +2913,10 @@ nsNativeThemeWin::ClassicGetWidgetPadding(nsDeviceContext* aContext,
} }
nsresult nsresult
nsNativeThemeWin::ClassicGetMinimumWidgetSize(nsPresContext* aPresContext, nsIFrame* aFrame, nsNativeThemeWin::ClassicGetMinimumWidgetSize(nsIFrame* aFrame,
uint8_t aWidgetType, uint8_t aWidgetType,
LayoutDeviceIntSize* aResult, bool* aIsOverridable) LayoutDeviceIntSize* aResult,
bool* aIsOverridable)
{ {
(*aResult).width = (*aResult).height = 0; (*aResult).width = (*aResult).height = 0;
*aIsOverridable = true; *aIsOverridable = true;

View File

@ -101,13 +101,10 @@ protected:
nsIFrame* aFrame, nsIFrame* aFrame,
uint8_t aWidgetType, uint8_t aWidgetType,
nsIntMargin* aResult); nsIntMargin* aResult);
nsresult ClassicGetMinimumWidgetSize(nsPresContext* aPresContext, nsIFrame* aFrame, nsresult ClassicGetMinimumWidgetSize(nsIFrame* aFrame, uint8_t aWidgetType,
uint8_t aWidgetType,
mozilla::LayoutDeviceIntSize* aResult, mozilla::LayoutDeviceIntSize* aResult,
bool* aIsOverridable); bool* aIsOverridable);
bool ClassicThemeSupportsWidget(nsPresContext* aPresContext, bool ClassicThemeSupportsWidget(nsIFrame* aFrame, uint8_t aWidgetType);
nsIFrame* aFrame,
uint8_t aWidgetType);
void DrawCheckedRect(HDC hdc, const RECT& rc, int32_t fore, int32_t back, void DrawCheckedRect(HDC hdc, const RECT& rc, int32_t fore, int32_t back,
HBRUSH defaultBack); HBRUSH defaultBack);
uint32_t GetWidgetNativeDrawingFlags(uint8_t aWidgetType); uint32_t GetWidgetNativeDrawingFlags(uint8_t aWidgetType);