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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2682,7 +2682,7 @@ public:
virtual void ConfigureLayer(ImageLayer* aLayer,
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);
virtual bool ShouldFixToViewport(nsDisplayListBuilder* aBuilder) override;

View File

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

View File

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

View File

@ -715,7 +715,7 @@ nsGlyphTableList::GetGlyphTableFor(const nsAString& aFamily)
// -----------------------------------------------------------------------------
static nsresult
InitGlobals(nsPresContext* aPresContext)
InitCharGlobals()
{
NS_ASSERTION(!gGlyphTableInitialized, "Error -- already initialized");
gGlyphTableInitialized = true;
@ -776,11 +776,10 @@ nsMathMLChar::SetStyleContext(nsStyleContext* aStyleContext)
}
void
nsMathMLChar::SetData(nsPresContext* aPresContext,
nsString& aData)
nsMathMLChar::SetData(nsString& aData)
{
if (!gGlyphTableInitialized) {
InitGlobals(aPresContext);
InitCharGlobals();
}
mData = aData;
// some assumptions until proven otherwise
@ -878,7 +877,7 @@ nsMathMLChar::SetData(nsPresContext* aPresContext,
#define NS_MATHML_DELIMITER_SHORTFALL_POINTS 5.0f
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
// 1-DelimiterFactor). This often gives a chance to the base size to
@ -1243,8 +1242,7 @@ StretchEnumContext::TryVariants(nsGlyphTable* aGlyphTable,
}
return haveBetter &&
(largeopOnly ||
IsSizeOK(mPresContext, bestSize, mTargetSize, mStretchHint));
(largeopOnly || IsSizeOK(bestSize, mTargetSize, mStretchHint));
}
// 3. Build by parts.
@ -1415,7 +1413,7 @@ nsMathMLChar::StretchEnumContext::TryParts(nsGlyphTable* aGlyphTable,
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
@ -1640,7 +1638,7 @@ nsMathMLChar::StretchInternal(nsPresContext* aPresContext,
// and not a largeop in display mode; we're done if size fits
if ((targetSize <= 0) ||
((isVertical && charSize >= targetSize) ||
IsSizeOK(aPresContext, charSize, targetSize, aStretchHint)))
IsSizeOK(charSize, targetSize, aStretchHint)))
done = true;
}

View File

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

View File

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

View File

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

View File

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

View File

@ -133,7 +133,7 @@ nsMathMLmoFrame::ProcessTextData()
nsPresContext* presContext = PresContext();
if (mFrames.GetLength() != 1) {
data.Truncate(); // empty data to reset the char
mMathMLChar.SetData(presContext, data);
mMathMLChar.SetData(data);
ResolveMathMLCharStyle(presContext, mContent, mStyleContext, &mMathMLChar);
return;
}
@ -177,7 +177,7 @@ nsMathMLmoFrame::ProcessTextData()
}
// cache the operator
mMathMLChar.SetData(presContext, data);
mMathMLChar.SetData(data);
// cache the native direction -- beware of bug 133429...
// 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
// up-to-date if dynamic changes arise.
nsAutoString sqrChar; sqrChar.Assign(kSqrChar);
mSqrChar.SetData(presContext, sqrChar);
mSqrChar.SetData(sqrChar);
ResolveMathMLCharStyle(presContext, mContent, mStyleContext, &mSqrChar);
}

View File

@ -781,8 +781,7 @@ nsMathMLmtableOuterFrame::AttributeChanged(int32_t aNameSpaceID,
}
nsIFrame*
nsMathMLmtableOuterFrame::GetRowFrameAt(nsPresContext* aPresContext,
int32_t aRowIndex)
nsMathMLmtableOuterFrame::GetRowFrameAt(int32_t aRowIndex)
{
int32_t rowCount = GetRowCount();
@ -846,7 +845,7 @@ nsMathMLmtableOuterFrame::Reflow(nsPresContext* aPresContext,
nscoord blockSize = aDesiredSize.BSize(wm);
nsIFrame* rowFrame = nullptr;
if (rowIndex) {
rowFrame = GetRowFrameAt(aPresContext, rowIndex);
rowFrame = GetRowFrameAt(rowIndex);
if (rowFrame) {
// translate the coordinates to be relative to us and in our writing mode
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
// up to the first row. Used for alignments that are relative to a given row
nsIFrame*
GetRowFrameAt(nsPresContext* aPresContext,
int32_t aRowIndex);
GetRowFrameAt(int32_t aRowIndex);
}; // class nsMathMLmtableOuterFrame
// --------------

View File

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

View File

@ -372,7 +372,7 @@ GetWindowsTheme(nsPresContext* aPresContext, const nsMediaFeature* aFeature,
}
static nsresult
GetOperatinSystemVersion(nsPresContext* aPresContext, const nsMediaFeature* aFeature,
GetOperatingSystemVersion(nsPresContext* aPresContext, const nsMediaFeature* aFeature,
nsCSSValue& aResult)
{
aResult.Reset();
@ -715,7 +715,7 @@ nsMediaFeatures::features[] = {
nsMediaFeature::eIdent,
nsMediaFeature::eNoRequirements,
{ 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
// reflow without an unconstrained bsize.
static nscoord
CalcUnpaginatedBSize(nsPresContext* aPresContext,
nsTableCellFrame& aCellFrame,
nsTableFrame& aTableFrame,
nscoord aBlockDirBorderPadding)
CalcUnpaginatedBSize(nsTableCellFrame& aCellFrame,
nsTableFrame& aTableFrame,
nscoord aBlockDirBorderPadding)
{
const nsTableCellFrame* firstCellInFlow =
static_cast<nsTableCellFrame*>(aCellFrame.FirstInFlow());
@ -852,7 +851,7 @@ CalcUnpaginatedBSize(nsPresContext* aPresContext,
break;
}
else if (rowX >= rowIndex) {
computedBSize += row->GetUnpaginatedBSize(aPresContext);
computedBSize += row->GetUnpaginatedBSize();
}
}
return computedBSize;
@ -910,7 +909,7 @@ nsTableCellFrame::Reflow(nsPresContext* aPresContext,
}
else if (aPresContext->IsPaginated()) {
nscoord computedUnpaginatedBSize =
CalcUnpaginatedBSize(aPresContext, (nsTableCellFrame&)*this,
CalcUnpaginatedBSize((nsTableCellFrame&)*this,
*tableFrame, borderPadding.BStartEnd(wm));
if (computedUnpaginatedBSize > 0) {
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
static
nscoord CalcBSizeFromUnpaginatedBSize(nsPresContext* aPresContext,
nsTableRowFrame& aRow,
nscoord CalcBSizeFromUnpaginatedBSize(nsTableRowFrame& aRow,
WritingMode aWM)
{
nscoord bsize = 0;
nsTableRowFrame* firstInFlow =
static_cast<nsTableRowFrame*>(aRow.FirstInFlow());
if (firstInFlow->HasUnpaginatedBSize()) {
bsize = firstInFlow->GetUnpaginatedBSize(aPresContext);
bsize = firstInFlow->GetUnpaginatedBSize();
for (nsIFrame* prevInFlow = aRow.GetPrevInFlow(); prevInFlow;
prevInFlow = prevInFlow->GetPrevInFlow()) {
bsize -= prevInFlow->BSize(aWM);
@ -1038,7 +1037,7 @@ nsTableRowFrame::ReflowChildren(nsPresContext* aPresContext,
} else if (NS_UNCONSTRAINEDSIZE == aReflowState.AvailableBSize()) {
aDesiredSize.BSize(wm) = CalcBSize(aReflowState);
if (GetPrevInFlow()) {
nscoord bsize = CalcBSizeFromUnpaginatedBSize(aPresContext, *this, wm);
nscoord bsize = CalcBSizeFromUnpaginatedBSize(*this, wm);
aDesiredSize.BSize(wm) = std::max(aDesiredSize.BSize(wm), bsize);
} else {
if (isPaginated && HasStyleBSize()) {
@ -1048,14 +1047,13 @@ nsTableRowFrame::ReflowChildren(nsPresContext* aPresContext,
}
if (isPaginated && HasUnpaginatedBSize()) {
aDesiredSize.BSize(wm) = std::max(aDesiredSize.BSize(wm),
GetUnpaginatedBSize(aPresContext));
GetUnpaginatedBSize());
}
}
} else { // constrained bsize, paginated
// Compute the bsize we should have from style (subtracting the
// bsize from our prev-in-flows from the style bsize)
nscoord styleBSize = CalcBSizeFromUnpaginatedBSize(aPresContext, *this,
wm);
nscoord styleBSize = CalcBSizeFromUnpaginatedBSize(*this, wm);
if (styleBSize > aReflowState.AvailableBSize()) {
styleBSize = aReflowState.AvailableBSize();
NS_FRAME_SET_INCOMPLETE(aStatus);
@ -1432,7 +1430,7 @@ nsTableRowFrame::SetUnpaginatedBSize(nsPresContext* aPresContext,
}
nscoord
nsTableRowFrame::GetUnpaginatedBSize(nsPresContext* aPresContext)
nsTableRowFrame::GetUnpaginatedBSize()
{
FrameProperties props = FirstInFlow()->Properties();
return NS_PTR_TO_INT32(props.Get(RowUnpaginatedHeightProperty()));

View File

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

View File

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

View File

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

View File

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

View File

@ -222,7 +222,7 @@ private:
#ifdef DEBUG_LAYOUT
nsresult SetDebug(nsPresContext* aPresContext, bool aDebug);
bool GetInitialDebug(bool& aDebug);
void GetDebugPref(nsPresContext* aPresContext);
void GetDebugPref();
void GetDebugBorder(nsMargin& aInset);
void GetDebugPadding(nsMargin& aInset);
@ -230,7 +230,7 @@ private:
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, 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 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();
nsRect groupRect;
nsIFrame* groupBox = GetCaptionBox(presContext, groupRect);
nsIFrame* groupBox = GetCaptionBox(groupRect);
if (groupBox) {
// if the border is smaller than the legend. Move the border down
@ -253,7 +253,7 @@ nsGroupBoxFrame::PaintBorderBackground(nsRenderingContext& aRenderingContext,
}
nsIFrame*
nsGroupBoxFrame::GetCaptionBox(nsPresContext* aPresContext, nsRect& aCaptionRect)
nsGroupBoxFrame::GetCaptionBox(nsRect& aCaptionRect)
{
// first child is our grouped area
nsIFrame* box = nsBox::GetChildBox(this);

View File

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

View File

@ -122,7 +122,7 @@ public:
bool ContinueReflow(nscoord height);
NS_IMETHOD ListBoxAppendFrames(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,
nsIFrame* aChildFrame, nsIContent* aOldNextSibling);

View File

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

View File

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

View File

@ -235,10 +235,10 @@ protected:
// Update the menu's type (normal, checkbox, radio).
// 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
// checked items. This method can destroy the frame.
void UpdateMenuSpecialState(nsPresContext* aPresContext);
void UpdateMenuSpecialState();
// Examines the key node and builds the accelerator.
void BuildAcceleratorText(bool aNotify);

View File

@ -1747,7 +1747,7 @@ void nsMenuPopupFrame::ChangeByPage(bool aIsUp)
// Only consider menu frames.
nsMenuFrame* menuFrame = do_QueryFrame(currentMenu);
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 ((!aIsUp && currentMenu->GetRect().YMost() > targetPosition) ||

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2320,7 +2320,7 @@ nsXULPopupManager::GetNextMenuItem(nsContainerFrame* aParent,
while (currFrame) {
// See if it's a menu item.
nsIContent* currFrameContent = currFrame->GetContent();
if (IsValidMenuItem(presContext, currFrameContent, aIsPopup)) {
if (IsValidMenuItem(currFrameContent, aIsPopup)) {
return do_QueryFrame(currFrame);
}
if (currFrameContent->IsXULElement(nsGkAtoms::menugroup) &&
@ -2339,7 +2339,7 @@ nsXULPopupManager::GetNextMenuItem(nsContainerFrame* aParent,
while (currFrame && currFrame != aStart) {
// See if it's a menu item.
nsIContent* currFrameContent = currFrame->GetContent();
if (IsValidMenuItem(presContext, currFrameContent, aIsPopup)) {
if (IsValidMenuItem(currFrameContent, aIsPopup)) {
return do_QueryFrame(currFrame);
}
if (currFrameContent->IsXULElement(nsGkAtoms::menugroup) &&
@ -2383,7 +2383,7 @@ nsXULPopupManager::GetPreviousMenuItem(nsContainerFrame* aParent,
while (currFrame) {
// See if it's a menu item.
nsIContent* currFrameContent = currFrame->GetContent();
if (IsValidMenuItem(presContext, currFrameContent, aIsPopup)) {
if (IsValidMenuItem(currFrameContent, aIsPopup)) {
return do_QueryFrame(currFrame);
}
if (currFrameContent->IsXULElement(nsGkAtoms::menugroup) &&
@ -2404,7 +2404,7 @@ nsXULPopupManager::GetPreviousMenuItem(nsContainerFrame* aParent,
while (currFrame && currFrame != aStart) {
// See if it's a menu item.
nsIContent* currFrameContent = currFrame->GetContent();
if (IsValidMenuItem(presContext, currFrameContent, aIsPopup)) {
if (IsValidMenuItem(currFrameContent, aIsPopup)) {
return do_QueryFrame(currFrame);
}
if (currFrameContent->IsXULElement(nsGkAtoms::menugroup) &&
@ -2424,9 +2424,7 @@ nsXULPopupManager::GetPreviousMenuItem(nsContainerFrame* aParent,
}
bool
nsXULPopupManager::IsValidMenuItem(nsPresContext* aPresContext,
nsIContent* aContent,
bool aOnPopup)
nsXULPopupManager::IsValidMenuItem(nsIContent* aContent, bool aOnPopup)
{
if (aContent->IsXULElement()) {
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
// be navigated to. aIsPopup should be true for items on a popup, or false
// for items on a menubar.
static bool IsValidMenuItem(nsPresContext* aPresContext,
nsIContent* aContent,
bool aOnPopup);
static bool IsValidMenuItem(nsIContent* aContent, bool aOnPopup);
// 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

View File

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

View File

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

View File

@ -2258,9 +2258,9 @@ nsNativeThemeWin::GetMinimumWidgetSize(nsPresContext* aPresContext, nsIFrame* aF
*aIsOverridable = true;
HANDLE theme = GetTheme(aWidgetType);
if (!theme)
return ClassicGetMinimumWidgetSize(aPresContext, aFrame, aWidgetType, aResult, aIsOverridable);
if (!theme) {
return ClassicGetMinimumWidgetSize(aFrame, aWidgetType, aResult, aIsOverridable);
}
switch (aWidgetType) {
case NS_THEME_GROUPBOX:
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_VERTICAL:
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_CHECKMENUITEM:
@ -2611,14 +2611,14 @@ nsNativeThemeWin::ThemeSupportsWidget(nsPresContext* aPresContext,
theme = GetTheme(NS_THEME_RADIO);
else
theme = GetTheme(aWidgetType);
if (theme && aWidgetType == NS_THEME_RESIZER)
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
return (!IsWidgetStyled(aPresContext, aFrame, aWidgetType));
return false;
}
@ -2735,10 +2735,9 @@ nsNativeThemeWin::GetWidgetTransparency(nsIFrame* aFrame, uint8_t aWidgetType)
/* Windows 9x/NT/2000/Classic XP Theme Support */
bool
nsNativeThemeWin::ClassicThemeSupportsWidget(nsPresContext* aPresContext,
nsIFrame* aFrame,
uint8_t aWidgetType)
bool
nsNativeThemeWin::ClassicThemeSupportsWidget(nsIFrame* aFrame,
uint8_t aWidgetType)
{
switch (aWidgetType) {
case NS_THEME_RESIZER:
@ -2914,9 +2913,10 @@ nsNativeThemeWin::ClassicGetWidgetPadding(nsDeviceContext* aContext,
}
nsresult
nsNativeThemeWin::ClassicGetMinimumWidgetSize(nsPresContext* aPresContext, nsIFrame* aFrame,
uint8_t aWidgetType,
LayoutDeviceIntSize* aResult, bool* aIsOverridable)
nsNativeThemeWin::ClassicGetMinimumWidgetSize(nsIFrame* aFrame,
uint8_t aWidgetType,
LayoutDeviceIntSize* aResult,
bool* aIsOverridable)
{
(*aResult).width = (*aResult).height = 0;
*aIsOverridable = true;

View File

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