Changed SetView/GetView to take an additional argument which is the

pres context
This commit is contained in:
troy%netscape.com 1999-10-26 04:44:41 +00:00
Родитель c98faaa66d
Коммит a47e8db44b
240 изменённых файлов: 2258 добавлений и 1704 удалений

Просмотреть файл

@ -1920,9 +1920,11 @@ nsDocument::GetPixelDimensions(nsIPresShell* aShell,
result = aShell->GetPrimaryFrameFor(mRootContent, &frame);
if (NS_SUCCEEDED(result) && frame) {
nsIView* view;
nsIView* view;
nsCOMPtr<nsIPresContext> presContext;
result = frame->GetView(&view);
aShell->GetPresContext(getter_AddRefs(presContext));
result = frame->GetView(presContext, &view);
if (NS_SUCCEEDED(result)) {
// If we have a view check if it's scrollable. If not,
// just use the view size itself

Просмотреть файл

@ -901,7 +901,7 @@ nsGenericElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult,
//----------------------------------------------------------------------
nsresult
nsGenericElement::RenderFrame()
nsGenericElement::RenderFrame(nsIPresContext* aPresContext)
{
nsPoint offset;
nsRect bounds;
@ -925,7 +925,7 @@ nsGenericElement::RenderFrame()
// XXX We should tell the frame the damage area and let it invalidate
// itself. Add some API calls to nsIFrame to allow a caller to invalidate
// parts of the frame...
frame->GetOffsetFromView(offset, &view);
frame->GetOffsetFromView(aPresContext, offset, &view);
view->GetViewManager(vm);
bounds.x += offset.x;
bounds.y += offset.y;

Просмотреть файл

@ -184,7 +184,7 @@ public:
//----------------------------------------
nsresult RenderFrame();
nsresult RenderFrame(nsIPresContext*);
nsresult AddScriptEventListener(nsIAtom* aAttribute,
const nsString& aValue,

Просмотреть файл

@ -648,7 +648,7 @@ nsEventStateManager::UpdateCursor(nsIPresContext& aPresContext, nsPoint& aPoint,
}
nsIWidget* window;
aTargetFrame->GetWindow(&window);
aTargetFrame->GetWindow(&aPresContext, &window);
window->SetCursor(c);
NS_RELEASE(window);
}
@ -1378,7 +1378,7 @@ nsEventStateManager::SetContentState(nsIContent *aContent, PRInt32 aState)
}
if ((aState & NS_EVENT_STATE_FOCUS) && (aContent != mCurrentFocus)) {
SendFocusBlur(aContent);
SendFocusBlur(mPresContext, aContent);
//transferring ref to notifyContent from mCurrentFocus
notifyContent[3] = mCurrentFocus;
@ -1468,7 +1468,7 @@ nsEventStateManager::SetContentState(nsIContent *aContent, PRInt32 aState)
}
NS_IMETHODIMP
nsEventStateManager::SendFocusBlur(nsIContent *aContent)
nsEventStateManager::SendFocusBlur(nsIPresContext* aPresContext, nsIContent *aContent)
{
if (mCurrentFocus == aContent) {
return NS_OK;
@ -1543,7 +1543,7 @@ nsEventStateManager::SendFocusBlur(nsIContent *aContent)
PRBool shouldSetFocusOnWindow = PR_TRUE;
if (nsnull != currentFocusFrame) {
nsIView * view = nsnull;
currentFocusFrame->GetView(&view);
currentFocusFrame->GetView(aPresContext, &view);
if (view != nsnull) {
nsIWidget *window = nsnull;
view->GetWidget(window);
@ -1563,10 +1563,10 @@ nsEventStateManager::SendFocusBlur(nsIContent *aContent)
// then click on a gfx control (generates another focus event)
if (shouldSetFocusOnWindow && nsnull != currentFocusFrame) {
nsIFrame * parentFrame;
currentFocusFrame->GetParentWithView(&parentFrame);
currentFocusFrame->GetParentWithView(aPresContext, &parentFrame);
if (nsnull != parentFrame) {
nsIView * pView;
parentFrame->GetView(&pView);
parentFrame->GetView(aPresContext, &pView);
if (nsnull != pView) {
nsIWidget *window = nsnull;

Просмотреть файл

@ -72,7 +72,7 @@ protected:
void ShiftFocus(PRBool foward);
nsIContent* GetNextTabbableContent(nsIContent* aParent, nsIContent* aChild, nsIContent* aTop, PRBool foward);
PRInt32 GetNextTabIndex(nsIContent* aParent, PRBool foward);
NS_IMETHOD SendFocusBlur(nsIContent *aContent);
NS_IMETHOD SendFocusBlur(nsIPresContext* aPresContext, nsIContent *aContent);
nsIScrollableView* GetNearestScrollingView(nsIView* aView);
// routines for the d&d gesture tracking state machine

Просмотреть файл

@ -1608,6 +1608,29 @@ nsGenericHTMLElement::GetPrimaryFrame(nsIHTMLContent* aContent,
return res;
}
// XXX This creates a dependency between content and frames
nsresult
nsGenericHTMLElement::GetPresContext(nsIHTMLContent* aContent,
nsIPresContext** aPresContext)
{
nsIDocument* doc = nsnull;
nsresult res = NS_NOINTERFACE;
// Get the document
if (NS_OK == aContent->GetDocument(doc)) {
if (nsnull != doc) {
// Get presentation shell 0
nsIPresShell* presShell = doc->GetShellAt(0);
if (nsnull != presShell) {
res = presShell->GetPresContext(aPresContext);
NS_RELEASE(presShell);
}
NS_RELEASE(doc);
}
}
return res;
}
// XXX check all mappings against ebina's usage
static nsGenericHTMLElement::EnumTable kAlignTable[] = {

Просмотреть файл

@ -277,9 +277,10 @@ public:
static PRBool GetBackgroundAttributesImpact(const nsIAtom* aAttribute,
PRInt32& aHint);
//XXX This creates a dependency between content and frames
//XXX These two creates a dependency between content and frames
static nsresult GetPrimaryFrame(nsIHTMLContent* aContent,
nsIFormControlFrame *&aFormControlFrame);
static nsresult GetPresContext(nsIHTMLContent* aContent, nsIPresContext** aPresContext);
static nsresult GetBaseURL(const nsHTMLValue& aBaseHref,
nsIDocument* aDocument,

Просмотреть файл

@ -341,7 +341,10 @@ nsHTMLFormElement::Reset()
nsIFormManager* formMan = nsnull;
res = frame->QueryInterface(kIFormManagerIID, (void**)&formMan);
if (NS_SUCCEEDED(res) && formMan) {
res = formMan->OnReset();
nsCOMPtr<nsIPresContext> presContext;
shell->GetPresContext(getter_AddRefs(presContext));
res = formMan->OnReset(presContext);
}
}
NS_RELEASE(shell);

Просмотреть файл

@ -358,7 +358,10 @@ nsHTMLInputElement::SetValue(const nsString& aValue)
nsIFormControlFrame* formControlFrame = nsnull;
if (NS_SUCCEEDED(nsGenericHTMLElement::GetPrimaryFrame(this, formControlFrame))) {
if (nsnull != formControlFrame ) {
formControlFrame->SetProperty(nsHTMLAtoms::value, aValue);
nsIPresContext* presContext;
nsGenericHTMLElement::GetPresContext(this, &presContext);
formControlFrame->SetProperty(presContext, nsHTMLAtoms::value, aValue);
NS_IF_RELEASE(presContext);
}
return NS_OK;
}
@ -396,7 +399,10 @@ nsHTMLInputElement::SetAutocomplete(const nsString& aAutocomplete)
nsIFormControlFrame* formControlFrame = nsnull;
if (NS_SUCCEEDED(nsGenericHTMLElement::GetPrimaryFrame(this, formControlFrame))) {
if (nsnull != formControlFrame ) {
formControlFrame->SetProperty(nsHTMLAtoms::autocomplete, aAutocomplete);
nsIPresContext* presContext;
nsGenericHTMLElement::GetPresContext(this, &presContext);
formControlFrame->SetProperty(presContext, nsHTMLAtoms::autocomplete, aAutocomplete);
NS_IF_RELEASE(presContext);
}
}
}
@ -426,12 +432,15 @@ nsHTMLInputElement::SetChecked(PRBool aValue)
{
nsIFormControlFrame* formControlFrame = nsnull;
if (NS_OK == nsGenericHTMLElement::GetPrimaryFrame(this, formControlFrame)) {
nsIPresContext* presContext;
nsGenericHTMLElement::GetPresContext(this, &presContext);
if (PR_TRUE == aValue) {
formControlFrame->SetProperty(nsHTMLAtoms::checked, "1");
formControlFrame->SetProperty(presContext, nsHTMLAtoms::checked, "1");
}
else {
formControlFrame->SetProperty(nsHTMLAtoms::checked, "0");
formControlFrame->SetProperty(presContext, nsHTMLAtoms::checked, "0");
}
NS_IF_RELEASE(presContext);
}
return NS_OK;
}
@ -518,7 +527,10 @@ nsHTMLInputElement::Select()
nsresult rv = nsGenericHTMLElement::GetPrimaryFrame(this, formControlFrame);
if (NS_SUCCEEDED(rv)) {
if (nsnull != formControlFrame ) {
formControlFrame->SetProperty(nsHTMLAtoms::select, "");
nsIPresContext* presContext;
nsGenericHTMLElement::GetPresContext(this, &presContext);
formControlFrame->SetProperty(presContext, nsHTMLAtoms::select, "");
NS_IF_RELEASE(presContext);
return NS_OK;
}
}

Просмотреть файл

@ -485,7 +485,10 @@ nsHTMLSelectElement::SetSelectedIndex(PRInt32 aValue)
if (NS_OK == nsGenericHTMLElement::GetPrimaryFrame(this, formControlFrame)) {
nsString value;
value.Append(aValue, 10);
formControlFrame->SetProperty(nsHTMLAtoms::selectedindex, value);
nsIPresContext* presContext;
nsGenericHTMLElement::GetPresContext(this, &presContext);
formControlFrame->SetProperty(presContext, nsHTMLAtoms::selectedindex, value);
NS_IF_RELEASE(presContext);
}
return NS_OK;
}
@ -654,7 +657,10 @@ nsHTMLSelectElement::AddOption(nsIContent* aContent)
nsISelectControlFrame* selectFrame = nsnull;
result = fcFrame->QueryInterface(nsISelectControlFrame::GetIID(),(void **) &selectFrame);
if (NS_SUCCEEDED(result) && (nsnull != selectFrame)) {
result = selectFrame->AddOption(mOptions->IndexOf(aContent));
nsIPresContext* presContext;
nsGenericHTMLElement::GetPresContext(this, &presContext);
result = selectFrame->AddOption(presContext, mOptions->IndexOf(aContent));
NS_IF_RELEASE(presContext);
}
}
@ -683,7 +689,10 @@ nsHTMLSelectElement::RemoveOption(nsIContent* aContent)
// We can't get our index if we've already been replaced in the OptionList.
// If we couldn't get our index, pass -1, remove all options and recreate
// Coincidentally, IndexOf returns -1 if the option isn't found in the list
result = selectFrame->RemoveOption(oldIndex);
nsIPresContext* presContext;
nsGenericHTMLElement::GetPresContext(this, &presContext);
result = selectFrame->RemoveOption(presContext, oldIndex);
NS_IF_RELEASE(presContext);
}
}

Просмотреть файл

@ -291,7 +291,10 @@ nsHTMLTextAreaElement::Select()
nsresult rv = nsGenericHTMLElement::GetPrimaryFrame(this, formControlFrame);
if (NS_SUCCEEDED(rv)) {
if (nsnull != formControlFrame ) {
formControlFrame->SetProperty(nsHTMLAtoms::select, "");
nsIPresContext* presContext;
nsGenericHTMLElement::GetPresContext(this, &presContext);
formControlFrame->SetProperty(presContext, nsHTMLAtoms::select, "");
NS_IF_RELEASE(presContext);
return NS_OK;
}
}
@ -332,7 +335,10 @@ nsHTMLTextAreaElement::SetValue(const nsString& aValue)
{
nsIFormControlFrame* formControlFrame = nsnull;
if (NS_OK == nsGenericHTMLElement::GetPrimaryFrame(this, formControlFrame)) {
formControlFrame->SetProperty(nsHTMLAtoms::value, aValue);
nsIPresContext* presContext;
nsGenericHTMLElement::GetPresContext(this, &presContext);
formControlFrame->SetProperty(presContext, nsHTMLAtoms::value, aValue);
NS_IF_RELEASE(presContext);
}
return NS_OK;
}

Просмотреть файл

@ -2552,7 +2552,9 @@ HTMLContentSink::ScrollToRef()
// coordinates that are relative to that.
nsPoint offset;
nsIView* view;
frame->GetOffsetFromView(offset, &view);
nsCOMPtr<nsIPresContext> presContext;
shell->GetPresContext(getter_AddRefs(presContext));
frame->GetOffsetFromView(presContext, offset, &view);
nscoord x = 0;
nscoord y = offset.y;
sview->SetScrollPreference(mOriginalScrollPreference);

Просмотреть файл

@ -2258,12 +2258,12 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresContext* aPresCo
nsIView* view;
if (IsScrollable(aPresContext, display)) {
contentFrame->GetView(&view);
contentFrame->GetView(aPresContext, &view);
} else {
nsIFrame* parentFrame;
contentFrame->GetParent(&parentFrame);
parentFrame->GetView(&view);
parentFrame->GetView(aPresContext, &view);
}
NS_ASSERTION(view, "expected a view");
@ -2635,7 +2635,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext,
nsIView* rootView;
viewManager->GetRootView(rootView);
viewportFrame->SetView(rootView);
viewportFrame->SetView(aPresContext, rootView);
// The viewport is the containing block for 'fixed' elements
mFixedContainingBlock = viewportFrame;
@ -2751,7 +2751,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext,
// Inform the view manager about the root scrollable view
// get the scrolling view
nsIView* view = nsnull;
newScrollableFrame->GetView(&view);
newScrollableFrame->GetView(aPresContext, &view);
nsIScrollableView* scrollableView;
view->QueryInterface(kScrollViewIID, (void**)&scrollableView);
viewManager->SetRootScrollableView(scrollableView);
@ -3410,7 +3410,7 @@ nsresult rv = NS_OK;
// XXX: We should replace this with a real widget manager similar
// to how the nsFormControlFrame works. Re-directing events is a temporary Kludge.
nsIView *listView;
listFrame->GetView(&listView);
listFrame->GetView(aPresContext, &listView);
NS_ASSERTION(nsnull != listView,"ListFrame's view is nsnull");
//listView->SetViewFlags(NS_VIEW_PUBLIC_FLAG_DONT_CHECK_CHILDREN);
@ -3458,7 +3458,7 @@ nsresult rv = NS_OK;
// to how the nsFormControlFrame works.
// Re-directing events is a temporary Kludge.
nsIView *listView;
listFrame->GetView(&listView);
listFrame->GetView(aPresContext, &listView);
NS_ASSERTION(nsnull != listView,"ListFrame's view is nsnull");
//listView->SetViewFlags(NS_VIEW_PUBLIC_FLAG_DONT_CHECK_CHILDREN);
aFrameHasBeenInitialized = PR_TRUE;
@ -7197,7 +7197,7 @@ UpdateViewsForTree(nsIPresContext& aPresContext, nsIFrame* aFrame,
nsIViewManager* aViewManager, nsRect& aBoundsRect)
{
nsIView* view;
aFrame->GetView(&view);
aFrame->GetView(&aPresContext, &view);
if (view) {
SyncAndInvalidateView(view, aFrame, aViewManager);
@ -7273,10 +7273,10 @@ ApplyRenderingChangeToTree(nsIPresContext& aPresContext,
// (adjusting r's coordinate system to reflect the nesting) and
// update there.
nsIView* view = nsnull;
aFrame->GetView(&view);
aFrame->GetView(&aPresContext, &view);
nsIView* parentView;
if (! view) { // XXX can view have children outside it?
aFrame->GetOffsetFromView(viewOffset, &parentView);
aFrame->GetOffsetFromView(&aPresContext, viewOffset, &parentView);
NS_ASSERTION(nsnull != parentView, "no view");
if (! viewManager) {
parentView->GetViewManager(viewManager);

Просмотреть файл

@ -1816,14 +1816,14 @@ ComputeBackgroundAnchorPoint(const nsStyleColor& aColor,
// Returns the clip view associated with the scroll frame's scrolling
// view
static const nsIView*
GetClipView(nsIFrame* aScrollFrame)
GetClipView(nsIPresContext* aPresContext, nsIFrame* aScrollFrame)
{
nsIView* view;
nsIScrollableView* scrollingView;
const nsIView* clipView;
// Get the scrolling view
aScrollFrame->GetView(&view);
aScrollFrame->GetView(aPresContext, &view);
view->QueryInterface(kScrollViewIID, (void**)&scrollingView);
// Get the clip view
@ -1968,7 +1968,7 @@ nsCSSRendering::PaintBackground(nsIPresContext& aPresContext,
scrollFrame = GetNearestScrollFrame(aForFrame);
// Get the viewport size
clipView = GetClipView(scrollFrame);
clipView = GetClipView(&aPresContext, scrollFrame);
clipView->GetDimensions(&viewportArea.width, &viewportArea.height);
}
@ -1987,10 +1987,10 @@ nsCSSRendering::PaintBackground(nsIPresContext& aPresContext,
if (NS_STYLE_BG_ATTACHMENT_FIXED == aColor.mBackgroundAttachment) {
nsIView* view;
aForFrame->GetView(&view);
aForFrame->GetView(&aPresContext, &view);
if (!view) {
nsPoint offset;
aForFrame->GetOffsetFromView(offset, &view);
aForFrame->GetOffsetFromView(&aPresContext, offset, &view);
anchor -= offset;
}
NS_ASSERTION(view, "expected a view");

Просмотреть файл

@ -459,7 +459,9 @@ void nsCaret::GetViewForRendering(nsIFrame *caretFrame, EViewCoordinates coordTy
nsIView* theView = nsnull;
NS_ASSERTION(caretFrame, "Should have frame here");
caretFrame->GetOffsetFromView(viewOffset, &theView);
nsCOMPtr<nsIPresContext> presContext;
mPresShell->GetPresContext(getter_AddRefs(presContext));
caretFrame->GetOffsetFromView(presContext, viewOffset, &theView);
if (theView == nsnull) return;
nsIView* returnView = nsnull;

Просмотреть файл

@ -222,8 +222,12 @@ public:
PRInt32 aMinChange,
PRInt32& aTopLevelChange);
NS_IMETHOD CaptureFrameState(nsIFrame* aFrame, nsILayoutHistoryState* aState);
NS_IMETHOD RestoreFrameState(nsIFrame* aFrame, nsILayoutHistoryState* aState);
NS_IMETHOD CaptureFrameState(nsIPresContext* aPresContext,
nsIFrame* aFrame,
nsILayoutHistoryState* aState);
NS_IMETHOD RestoreFrameState(nsIPresContext* aPresContext,
nsIFrame* aFrame,
nsILayoutHistoryState* aState);
// Gets and sets properties on a given frame
NS_IMETHOD GetFrameProperty(nsIFrame* aFrame,
@ -1350,7 +1354,7 @@ FrameManager::ComputeStyleChangeFor(nsIPresContext& aPresContext,
static nsresult
CaptureFrameStateFor(nsIFrame* aFrame, nsILayoutHistoryState* aState)
CaptureFrameStateFor(nsIPresContext* aPresContext, nsIFrame* aFrame, nsILayoutHistoryState* aState)
{
nsresult rv = NS_OK;
NS_PRECONDITION(nsnull != aFrame && nsnull != aState, "null parameters passed in");
@ -1370,10 +1374,10 @@ CaptureFrameStateFor(nsIFrame* aFrame, nsILayoutHistoryState* aState)
rv = content->GetContentID(&ID);
if (NS_SUCCEEDED(rv) && ID) { // Must have ID (don't do anonymous content)
nsIStatefulFrame::StateType type = nsIStatefulFrame::eNoType;
rv = statefulFrame->GetStateType(&type);
rv = statefulFrame->GetStateType(aPresContext, &type);
if (NS_SUCCEEDED(rv)) {
nsISupports* frameState;
rv = statefulFrame->SaveState(&frameState);
rv = statefulFrame->SaveState(aPresContext, &frameState);
if (NS_SUCCEEDED(rv)) {
rv = aState->AddState(ID, frameState, type);
}
@ -1386,12 +1390,12 @@ CaptureFrameStateFor(nsIFrame* aFrame, nsILayoutHistoryState* aState)
}
NS_IMETHODIMP
FrameManager::CaptureFrameState(nsIFrame* aFrame, nsILayoutHistoryState* aState)
FrameManager::CaptureFrameState(nsIPresContext* aPresContext, nsIFrame* aFrame, nsILayoutHistoryState* aState)
{
nsresult rv = NS_OK;
NS_PRECONDITION(nsnull != aFrame && nsnull != aState, "null parameters passed in");
rv = CaptureFrameStateFor(aFrame, aState);
rv = CaptureFrameStateFor(aPresContext, aFrame, aState);
// Now capture state recursively for the frame hierarchy rooted at aFrame
nsIAtom* childListName = nsnull;
@ -1400,7 +1404,7 @@ FrameManager::CaptureFrameState(nsIFrame* aFrame, nsILayoutHistoryState* aState)
nsIFrame* childFrame;
aFrame->FirstChild(childListName, &childFrame);
while (childFrame) {
rv = CaptureFrameState(childFrame, aState);
rv = CaptureFrameState(aPresContext, childFrame, aState);
// Get the next sibling child frame
childFrame->GetNextSibling(&childFrame);
}
@ -1412,7 +1416,7 @@ FrameManager::CaptureFrameState(nsIFrame* aFrame, nsILayoutHistoryState* aState)
}
static nsresult
RestoreFrameStateFor(nsIFrame* aFrame, nsILayoutHistoryState* aState)
RestoreFrameStateFor(nsIPresContext* aPresContext, nsIFrame* aFrame, nsILayoutHistoryState* aState)
{
nsresult rv = NS_OK;
NS_PRECONDITION(nsnull != aFrame && nsnull != aState, "null parameters passed in");
@ -1431,12 +1435,12 @@ RestoreFrameStateFor(nsIFrame* aFrame, nsILayoutHistoryState* aState)
rv = content->GetContentID(&ID);
if (NS_SUCCEEDED(rv) && ID) { // Must have ID (don't do anonymous content)
nsIStatefulFrame::StateType type = nsIStatefulFrame::eNoType;
rv = statefulFrame->GetStateType(&type);
rv = statefulFrame->GetStateType(aPresContext, &type);
if (NS_SUCCEEDED(rv)) {
nsISupports* frameState = nsnull;
rv = aState->GetState(ID, &frameState, type);
if (NS_SUCCEEDED(rv) && nsnull != frameState) {
rv = statefulFrame->RestoreState(frameState);
rv = statefulFrame->RestoreState(aPresContext, frameState);
}
}
}
@ -1447,12 +1451,12 @@ RestoreFrameStateFor(nsIFrame* aFrame, nsILayoutHistoryState* aState)
}
NS_IMETHODIMP
FrameManager::RestoreFrameState(nsIFrame* aFrame, nsILayoutHistoryState* aState)
FrameManager::RestoreFrameState(nsIPresContext* aPresContext, nsIFrame* aFrame, nsILayoutHistoryState* aState)
{
nsresult rv = NS_OK;
NS_PRECONDITION(nsnull != aFrame && nsnull != aState, "null parameters passed in");
rv = RestoreFrameStateFor(aFrame, aState);
rv = RestoreFrameStateFor(aPresContext, aFrame, aState);
// Now restore state recursively for the frame hierarchy rooted at aFrame
nsIAtom* childListName = nsnull;
@ -1461,7 +1465,7 @@ FrameManager::RestoreFrameState(nsIFrame* aFrame, nsILayoutHistoryState* aState)
nsIFrame* childFrame;
aFrame->FirstChild(childListName, &childFrame);
while (childFrame) {
rv = RestoreFrameState(childFrame, aState);
rv = RestoreFrameState(aPresContext, childFrame, aState);
// Get the next sibling child frame
childFrame->GetNextSibling(&childFrame);
}

Просмотреть файл

@ -124,7 +124,7 @@ public:
* @param aGuiEvent is the event that should be dealt with by aFocusFrame
* @param aFrame is the frame that MAY handle the event
*/
NS_IMETHOD HandleKeyEvent(nsGUIEvent *aGuiEvent) = 0;
NS_IMETHOD HandleKeyEvent(nsIPresContext* aPresContext, nsGUIEvent *aGuiEvent) = 0;
/** HandleClick will take the focus to the new frame at the new offset and
* will either extend the selection from the old anchor, or replace the old anchor.
@ -210,7 +210,7 @@ public:
* specified by aSelectionType.
* @param aSelectionType enum value defined in nsIDOMSelection for the domseleciton you want.
*/
NS_IMETHOD RepaintSelection(SelectionType aSelectionType)=0;
NS_IMETHOD RepaintSelection(nsIPresContext* aPresContext, SelectionType aSelectionType)=0;
/** GetFrameForNodeOffset given a node and its child offset, return the nsIFrame and
* the offset into that frame.

Просмотреть файл

@ -830,7 +830,7 @@ PresShell::RepaintSelection(SelectionType aType)
if (!mSelection)
return NS_ERROR_NULL_POINTER;
return mSelection->RepaintSelection(aType);
return mSelection->RepaintSelection(mPresContext, aType);
}
NS_IMETHODIMP
@ -949,7 +949,7 @@ PresShell::InitialReflow(nscoord aWidth, nscoord aHeight)
if (NS_OK == rootFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
htmlReflow->Reflow(*mPresContext, desiredSize, reflowState, status);
rootFrame->SizeTo(desiredSize.width, desiredSize.height);
rootFrame->SizeTo(mPresContext, desiredSize.width, desiredSize.height);
mPresContext->SetVisibleArea(nsRect(0,0,desiredSize.width,desiredSize.height));
#ifdef NS_DEBUG
@ -1029,7 +1029,7 @@ PresShell::ResizeReflow(nscoord aWidth, nscoord aHeight)
if (NS_OK == rootFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
htmlReflow->Reflow(*mPresContext, desiredSize, reflowState, status);
rootFrame->SizeTo(desiredSize.width, desiredSize.height);
rootFrame->SizeTo(mPresContext, desiredSize.width, desiredSize.height);
#ifdef NS_DEBUG
if (nsIFrame::GetVerifyTreeEnable()) {
rootFrame->VerifyTree();
@ -1209,7 +1209,7 @@ PresShell::StyleChangeReflow()
if (NS_OK == rootFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
htmlReflow->Reflow(*mPresContext, desiredSize, reflowState, status);
rootFrame->SizeTo(desiredSize.width, desiredSize.height);
rootFrame->SizeTo(mPresContext, desiredSize.width, desiredSize.height);
#ifdef NS_DEBUG
if (nsIFrame::GetVerifyTreeEnable()) {
rootFrame->VerifyTree();
@ -1505,10 +1505,10 @@ PresShell::CreateRenderingContext(nsIFrame *aFrame,
nsPoint pt;
nsresult rv;
aFrame->GetView(&view);
aFrame->GetView(mPresContext, &view);
if (nsnull == view)
aFrame->GetOffsetFromView(pt, &view);
aFrame->GetOffsetFromView(mPresContext, pt, &view);
while (nsnull != view)
{
@ -1614,7 +1614,7 @@ PresShell::ScrollFrameIntoView(nsIFrame *aFrame,
// Determine the offset from aFrame to the scrolled view. We do that by
// getting the offset from its closest view and then walking up
scrollingView->GetScrolledView(scrolledView);
aFrame->GetOffsetFromView(offset, &closestView);
aFrame->GetOffsetFromView(mPresContext, offset, &closestView);
// XXX Deal with the case where there is a scrolled element, e.g., a
// DIV in the middle...
@ -1784,7 +1784,7 @@ PresShell::GetHistoryState(nsILayoutHistoryState** aState)
rv = GetRootFrame(&rootFrame);
if (NS_FAILED(rv) || nsnull == rootFrame) return rv;
rv = mFrameManager->CaptureFrameState(rootFrame, *aState);
rv = mFrameManager->CaptureFrameState(mPresContext, rootFrame, *aState);
return rv;
}
@ -1855,7 +1855,7 @@ PresShell::ContentAppended(nsIDocument *aDocument,
nsIFrame* frame;
rv = GetPrimaryFrameFor(aContainer, &frame);
if (NS_SUCCEEDED(rv) && nsnull != frame)
mFrameManager->RestoreFrameState(frame, mHistoryState);
mFrameManager->RestoreFrameState(mPresContext, frame, mHistoryState);
}
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: Frame Creation: PresShell::ContentAppended(), this=%p\n", this));
@ -2149,7 +2149,7 @@ PresShell::HandleEvent(nsIView *aView,
if (mSelection && aEvent->eventStructType == NS_KEY_EVENT)
{//KEY HANDLERS WILL GET RID OF THIS
if (mDisplayNonTextSelection && NS_SUCCEEDED(mSelection->HandleKeyEvent(aEvent)))
if (mDisplayNonTextSelection && NS_SUCCEEDED(mSelection->HandleKeyEvent(mPresContext, aEvent)))
{
return NS_OK;
}
@ -2176,10 +2176,10 @@ PresShell::HandleEvent(nsIView *aView,
manager->GetFocusedContent(&focusContent);
if (focusContent)
GetPrimaryFrameFor(focusContent, &mCurrentEventFrame);
else frame->GetFrameForPoint(aEvent->point, &mCurrentEventFrame);
else frame->GetFrameForPoint(mPresContext, aEvent->point, &mCurrentEventFrame);
}
else {
frame->GetFrameForPoint(aEvent->point, &mCurrentEventFrame);
frame->GetFrameForPoint(mPresContext, aEvent->point, &mCurrentEventFrame);
}
NS_IF_RELEASE(mCurrentEventContent);
if (GetCurrentEventFrame() || focusContent) {
@ -2316,7 +2316,7 @@ LogVerifyMessage(nsIFrame* k1, nsIFrame* k2, const char* aMsg,
}
static PRBool
CompareTrees(nsIFrame* aA, nsIFrame* aB)
CompareTrees(nsIPresContext* aPresContext, nsIFrame* aA, nsIFrame* aB)
{
PRBool ok = PR_TRUE;
nsIAtom* listName = nsnull;
@ -2359,8 +2359,8 @@ CompareTrees(nsIFrame* aA, nsIFrame* aB)
// do have views, make sure the views are the same size. If the
// views have widgets, make sure they both do or neither does. If
// they do, make sure the widgets are the same size.
k1->GetView(&v1);
k2->GetView(&v2);
k1->GetView(aPresContext, &v1);
k2->GetView(aPresContext, &v2);
if (((nsnull == v1) && (nsnull != v2)) ||
((nsnull != v1) && (nsnull == v2))) {
ok = PR_FALSE;
@ -2393,7 +2393,7 @@ CompareTrees(nsIFrame* aA, nsIFrame* aB)
}
// Compare the sub-trees too
if (!CompareTrees(k1, k2)) {
if (!CompareTrees(aPresContext, k1, k2)) {
ok = PR_FALSE;
if (0 == (VERIFY_REFLOW_ALL & gVerifyReflowFlags)) {
break;
@ -2640,12 +2640,12 @@ PresShell::VerifyIncrementalReflow()
root1 = FindTopFrame(root1);
root2 = FindTopFrame(root2);
#endif
PRBool ok = CompareTrees(root1, root2);
PRBool ok = CompareTrees(mPresContext, root1, root2);
if (!ok && (VERIFY_REFLOW_NOISY & gVerifyReflowFlags)) {
printf("Verify reflow failed, primary tree:\n");
root1->List(stdout, 0);
root1->List(mPresContext, stdout, 0);
printf("Verification tree:\n");
root2->List(stdout, 0);
root2->List(mPresContext, stdout, 0);
}
// printf("Incremental reflow doomed view tree:\n");

Просмотреть файл

@ -121,7 +121,7 @@ public:
void VerifyParent(nsIFrame* aParent) const;
void List(FILE* out) const;
void List(nsIPresContext* aPresContext, FILE* out) const;
protected:
nsIFrame* mFirstChild;

Просмотреть файл

@ -389,9 +389,14 @@ public:
NS_IMETHOD GetRect(nsRect& aRect) const = 0;
NS_IMETHOD GetOrigin(nsPoint& aPoint) const = 0;
NS_IMETHOD GetSize(nsSize& aSize) const = 0;
NS_IMETHOD SetRect(const nsRect& aRect) = 0;
NS_IMETHOD MoveTo(nscoord aX, nscoord aY) = 0;
NS_IMETHOD SizeTo(nscoord aWidth, nscoord aHeight) = 0;
NS_IMETHOD SetRect(nsIPresContext* aPresContext,
const nsRect& aRect) = 0;
NS_IMETHOD MoveTo(nsIPresContext* aPresContext,
nscoord aX,
nscoord aY) = 0;
NS_IMETHOD SizeTo(nsIPresContext* aPresContext,
nscoord aWidth,
nscoord aHeight) = 0;
/**
* Used to iterate the list of additional child list names. Returns the atom
@ -466,7 +471,8 @@ public:
nsPoint& aPoint,
PRInt32& aCursor) = 0;
NS_IMETHOD GetFrameForPoint(const nsPoint& aPoint,
NS_IMETHOD GetFrameForPoint(nsIPresContext* aPresContext,
const nsPoint& aPoint,
nsIFrame** aFrame) = 0;
@ -563,19 +569,24 @@ public:
/**
* Accessor functions to get/set the associated view object
*/
NS_IMETHOD GetView(nsIView** aView) const = 0; // may be null
NS_IMETHOD SetView(nsIView* aView) = 0;
NS_IMETHOD GetView(nsIPresContext* aPresContext,
nsIView** aView) const = 0; // may be null
NS_IMETHOD SetView(nsIPresContext* aPresContext,
nsIView* aView) = 0;
/**
* Find the first geometric parent that has a view
*/
NS_IMETHOD GetParentWithView(nsIFrame** aParent) const = 0;
NS_IMETHOD GetParentWithView(nsIPresContext* aPresContext,
nsIFrame** aParent) const = 0;
/**
* Returns the offset from this frame to the closest geometric parent that
* has a view. Also returns the containing view or null in case of error
*/
NS_IMETHOD GetOffsetFromView(nsPoint& aOffset, nsIView** aView) const = 0;
NS_IMETHOD GetOffsetFromView(nsIPresContext* aPresContext,
nsPoint& aOffset,
nsIView** aView) const = 0;
/**
* Returns the window that contains this frame. If this frame has a
@ -583,7 +594,8 @@ public:
* returned, otherwise this frame's geometric parent is checked
* recursively upwards.
*/
NS_IMETHOD GetWindow(nsIWidget**) const = 0;
NS_IMETHOD GetWindow(nsIPresContext* aPresContext,
nsIWidget** aWidget) const = 0;
/**
* Get the "type" of the frame. May return a NULL atom pointer
@ -604,7 +616,7 @@ public:
NS_IMETHOD Scrolled(nsIView *aView) = 0;
// Debugging
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const = 0;
NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const = 0;
/**
* Get a printable from of the name of the frame type.
@ -650,7 +662,10 @@ public:
* @param aSelected is it selected
* @param aSpread should is spread selection to flow elements around it? or go down to its children?
*/
NS_IMETHOD SetSelected(nsIDOMRange *aRange,PRBool aSelected, nsSpread aSpread) = 0;
NS_IMETHOD SetSelected(nsIPresContext* aPresContext,
nsIDOMRange* aRange,
PRBool aSelected,
nsSpread aSpread) = 0;
NS_IMETHOD GetSelected(PRBool *aSelected) const = 0;
@ -664,7 +679,7 @@ public:
* return NS_ERROR_FAILURE
* @param aPOS is defined in nsIFrameSelection
*/
NS_IMETHOD PeekOffset(nsPeekOffsetStruct *aPos) = 0;
NS_IMETHOD PeekOffset(nsIPresContext* aPresContext, nsPeekOffsetStruct *aPos) = 0;
/**
* See if tree verification is enabled. To enable tree verification add

Просмотреть файл

@ -147,8 +147,12 @@ public:
* aState is the document state storage object onto which each frame
* stores its state.
*/
NS_IMETHOD CaptureFrameState(nsIFrame* aFrame, nsILayoutHistoryState* aState) = 0;
NS_IMETHOD RestoreFrameState(nsIFrame* aFrame, nsILayoutHistoryState* aState) = 0;
NS_IMETHOD CaptureFrameState(nsIPresContext* aPresContext,
nsIFrame* aFrame,
nsILayoutHistoryState* aState) = 0;
NS_IMETHOD RestoreFrameState(nsIPresContext* aPresContext,
nsIFrame* aFrame,
nsILayoutHistoryState* aState) = 0;
/**
* Gets a property value for a given frame.

Просмотреть файл

@ -124,7 +124,7 @@ public:
* @param aGuiEvent is the event that should be dealt with by aFocusFrame
* @param aFrame is the frame that MAY handle the event
*/
NS_IMETHOD HandleKeyEvent(nsGUIEvent *aGuiEvent) = 0;
NS_IMETHOD HandleKeyEvent(nsIPresContext* aPresContext, nsGUIEvent *aGuiEvent) = 0;
/** HandleClick will take the focus to the new frame at the new offset and
* will either extend the selection from the old anchor, or replace the old anchor.
@ -210,7 +210,7 @@ public:
* specified by aSelectionType.
* @param aSelectionType enum value defined in nsIDOMSelection for the domseleciton you want.
*/
NS_IMETHOD RepaintSelection(SelectionType aSelectionType)=0;
NS_IMETHOD RepaintSelection(nsIPresContext* aPresContext, SelectionType aSelectionType)=0;
/** GetFrameForNodeOffset given a node and its child offset, return the nsIFrame and
* the offset into that frame.

Просмотреть файл

@ -3,6 +3,8 @@
#include "nsISupports.h"
class nsIPresContext;
#define NS_ISTATEFULFRAME_IID_STR "306c8ca0-5f0c-11d3-a9fb-000064657374"
#define NS_ISTATEFULFRAME_IID \
@ -18,9 +20,9 @@ class nsIStatefulFrame : public nsISupports {
enum StateType {eNoType=-1, eCheckboxType, eFileType, eRadioType, eSelectType,
eTextType, eNumStateTypes};
NS_IMETHOD GetStateType(nsIStatefulFrame::StateType* aStateType) = 0;
NS_IMETHOD SaveState(nsISupports** aState) = 0;
NS_IMETHOD RestoreState(nsISupports* aState) = 0;
NS_IMETHOD GetStateType(nsIPresContext* aPresContext, nsIStatefulFrame::StateType* aStateType) = 0;
NS_IMETHOD SaveState(nsIPresContext* aPresContext, nsISupports** aState) = 0;
NS_IMETHOD RestoreState(nsIPresContext* aPresContext, nsISupports* aState) = 0;
};

Просмотреть файл

@ -459,7 +459,9 @@ void nsCaret::GetViewForRendering(nsIFrame *caretFrame, EViewCoordinates coordTy
nsIView* theView = nsnull;
NS_ASSERTION(caretFrame, "Should have frame here");
caretFrame->GetOffsetFromView(viewOffset, &theView);
nsCOMPtr<nsIPresContext> presContext;
mPresShell->GetPresContext(getter_AddRefs(presContext));
caretFrame->GetOffsetFromView(presContext, viewOffset, &theView);
if (theView == nsnull) return;
nsIView* returnView = nsnull;

Просмотреть файл

@ -1920,9 +1920,11 @@ nsDocument::GetPixelDimensions(nsIPresShell* aShell,
result = aShell->GetPrimaryFrameFor(mRootContent, &frame);
if (NS_SUCCEEDED(result) && frame) {
nsIView* view;
nsIView* view;
nsCOMPtr<nsIPresContext> presContext;
result = frame->GetView(&view);
aShell->GetPresContext(getter_AddRefs(presContext));
result = frame->GetView(presContext, &view);
if (NS_SUCCEEDED(result)) {
// If we have a view check if it's scrollable. If not,
// just use the view size itself

Просмотреть файл

@ -439,7 +439,7 @@ nsFrameImageLoader::Notify(nsIImageRequest *aImageRequest,
// XXX this is pretty vile; change this so that we set another frame status bit and then pass on a notification *or* lets just start passing on the notifications directly to the frames and eliminate all of this code.
pfd = mFrames;
while (pfd) {
pfd->mFrame->GetView(&view);
pfd->mFrame->GetView(mPresContext, &view);
if (view) {
view->SetContentTransparency(PR_TRUE);
}
@ -541,9 +541,9 @@ nsFrameImageLoader::DamageRepairFrames(const nsRect* aDamageRect)
// XXX We should tell the frame the damage area and let it invalidate
// itself. Add some API calls to nsIFrame to allow a caller to invalidate
// parts of the frame...
frame->GetView(&view);
frame->GetView(mPresContext, &view);
if (nsnull == view) {
frame->GetOffsetFromView(offset, &view);
frame->GetOffsetFromView(mPresContext, offset, &view);
bounds.x += offset.x;
bounds.y += offset.y;
}

Просмотреть файл

@ -346,12 +346,12 @@ nsFrameList::VerifyParent(nsIFrame* aParent) const
}
void
nsFrameList::List(FILE* out) const
nsFrameList::List(nsIPresContext* aPresContext, FILE* out) const
{
fputs("<\n", out);
nsIFrame* frame = mFirstChild;
while (nsnull != frame) {
frame->List(out, 1);
frame->List(aPresContext, out, 1);
frame->GetNextSibling(&frame);
}
fputs(">\n", out);

Просмотреть файл

@ -901,7 +901,7 @@ nsGenericElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult,
//----------------------------------------------------------------------
nsresult
nsGenericElement::RenderFrame()
nsGenericElement::RenderFrame(nsIPresContext* aPresContext)
{
nsPoint offset;
nsRect bounds;
@ -925,7 +925,7 @@ nsGenericElement::RenderFrame()
// XXX We should tell the frame the damage area and let it invalidate
// itself. Add some API calls to nsIFrame to allow a caller to invalidate
// parts of the frame...
frame->GetOffsetFromView(offset, &view);
frame->GetOffsetFromView(aPresContext, offset, &view);
view->GetViewManager(vm);
bounds.x += offset.x;
bounds.y += offset.y;

Просмотреть файл

@ -184,7 +184,7 @@ public:
//----------------------------------------
nsresult RenderFrame();
nsresult RenderFrame(nsIPresContext*);
nsresult AddScriptEventListener(nsIAtom* aAttribute,
const nsString& aValue,

Просмотреть файл

@ -123,6 +123,7 @@ public:
/*END nsIScriptObjectOwner interface implementations*/
// utility methods for scrolling the selection into view
nsresult GetPresContext(nsIPresContext **aPresContext);
nsresult GetPresShell(nsIPresShell **aPresShell);
nsresult GetRootScrollableView(nsIScrollableView **aScrollableView);
nsresult GetFrameToRootViewOffset(nsIFrame *aFrame, nscoord *aXOffset, nscoord *aYOffset);
@ -134,7 +135,7 @@ public:
nsresult AddItem(nsIDOMRange *aRange);
nsresult RemoveItem(nsIDOMRange *aRange);
nsresult Clear();
nsresult Clear(nsIPresContext* aPresContext);
// methods for convenience. Note, these don't addref
nsIDOMNode* FetchAnchorNode(); //where did the selection begin
PRInt32 FetchAnchorOffset();
@ -159,7 +160,7 @@ public:
NS_IMETHOD GetOriginalAnchorPoint(nsIDOMNode **aNode, PRInt32 *aOffset);
NS_IMETHOD LookUpSelection(nsIContent *aContent, PRInt32 aContentOffset, PRInt32 aContentLength,
SelectionDetails **aReturnDetails, SelectionType aType);
NS_IMETHOD Repaint();
NS_IMETHOD Repaint(nsIPresContext* aPresContext);
nsresult StartAutoScrollTimer(nsIPresContext *aPresContext, nsIFrame *aFrame, nsPoint& aPoint, PRUint32 aDelay);
nsresult StopAutoScrollTimer();
@ -171,8 +172,8 @@ private:
void setAnchorFocusRange(PRInt32 aIndex); //pass in index into rangelist
NS_IMETHOD selectFrames(nsIContentIterator *aInnerIter, nsIContent *aContent, nsIDOMRange *aRange, PRBool aFlags);
NS_IMETHOD selectFrames(nsIDOMRange *aRange, PRBool aSelect);
NS_IMETHOD selectFrames(nsIPresContext* aPresContext, nsIContentIterator *aInnerIter, nsIContent *aContent, nsIDOMRange *aRange, PRBool aFlags);
NS_IMETHOD selectFrames(nsIPresContext* aPresContext, nsIDOMRange *aRange, PRBool aSelect);
#if OLD_SELECTION
NS_IMETHOD FixupSelectionPoints(nsIDOMRange *aRange, nsDirection *aDir, PRBool *aFixupState);
@ -206,7 +207,7 @@ public:
NS_IMETHOD Init(nsIFocusTracker *aTracker);
NS_IMETHOD ShutDown();
NS_IMETHOD HandleTextEvent(nsGUIEvent *aGUIEvent);
NS_IMETHOD HandleKeyEvent(nsGUIEvent *aGuiEvent);
NS_IMETHOD HandleKeyEvent(nsIPresContext* aPresContext, nsGUIEvent *aGuiEvent);
NS_IMETHOD HandleClick(nsIContent *aNewFocus, PRUint32 aContentOffset, PRUint32 aContentEndOffset,
PRBool aContinueSelection, PRBool aMultipleSelection,PRBool aHint);
NS_IMETHOD HandleDrag(nsIPresContext *aPresContext, nsIFrame *aFrame, nsPoint& aPoint);
@ -219,7 +220,7 @@ public:
NS_IMETHOD GetMouseDownState(PRBool *aState);
NS_IMETHOD GetSelection(SelectionType aType, nsIDOMSelection **aDomSelection);
NS_IMETHOD ScrollSelectionIntoView(SelectionType aType, SelectionRegion aRegion);
NS_IMETHOD RepaintSelection(SelectionType aType);
NS_IMETHOD RepaintSelection(nsIPresContext* aPresContext, SelectionType aType);
NS_IMETHOD GetFrameForNodeOffset(nsIContent *aNode, PRInt32 aOffset, nsIFrame **aReturnFrame);
/*END nsIFrameSelection interfacse*/
@ -845,7 +846,7 @@ nsRangeList::HandleTextEvent(nsGUIEvent *aGUIEvent)
* focus DomNode, it is invalid? The answer now is yes.
*/
NS_IMETHODIMP
nsRangeList::HandleKeyEvent(nsGUIEvent *aGuiEvent)
nsRangeList::HandleKeyEvent(nsIPresContext* aPresContext, nsGUIEvent *aGuiEvent)
{
if (!aGuiEvent)
return NS_ERROR_NULL_POINTER;
@ -959,7 +960,7 @@ nsRangeList::HandleKeyEvent(nsGUIEvent *aGuiEvent)
default :return NS_ERROR_FAILURE;
}
pos.mPreferLeft = mHint;
if (NS_SUCCEEDED(result) && NS_SUCCEEDED(frame->PeekOffset(&pos)) && pos.mResultContent)
if (NS_SUCCEEDED(result) && NS_SUCCEEDED(frame->PeekOffset(aPresContext, &pos)) && pos.mResultContent)
{
mHint = (HINT)pos.mPreferLeft;
result = TakeFocus(pos.mResultContent, pos.mContentOffset, pos.mContentOffset, keyEvent->isShift, PR_FALSE);
@ -1202,7 +1203,7 @@ nsRangeList::ScrollSelectionIntoView(SelectionType aType, SelectionRegion aRegio
}
NS_IMETHODIMP
nsRangeList::RepaintSelection(SelectionType aType)
nsRangeList::RepaintSelection(nsIPresContext* aPresContext, SelectionType aType)
{
if (aType < SELECTION_NORMAL || aType >= NUM_SELECTIONTYPES)
return NS_ERROR_FAILURE;
@ -1210,7 +1211,7 @@ nsRangeList::RepaintSelection(SelectionType aType)
if (!mDomSelections[aType])
return NS_ERROR_NULL_POINTER;
return mDomSelections[aType]->Repaint();
return mDomSelections[aType]->Repaint(aPresContext);
}
NS_IMETHODIMP
@ -1734,7 +1735,7 @@ nsDOMSelection::RemoveItem(nsIDOMRange *aItem)
nsresult
nsDOMSelection::Clear()
nsDOMSelection::Clear(nsIPresContext* aPresContext)
{
setAnchorFocusRange(-1);
if (!mRangeArray)
@ -1750,7 +1751,7 @@ nsDOMSelection::Clear()
nsCOMPtr<nsISupports> isupportsindex = dont_AddRef(mRangeArray->ElementAt(0));
nsCOMPtr<nsIDOMRange> range = do_QueryInterface(isupportsindex);
mRangeArray->RemoveElementAt(0);
selectFrames(range, 0);
selectFrames(aPresContext, range, 0);
// Does RemoveElementAt also delete the elements?
}
@ -1843,7 +1844,11 @@ nsDOMSelection::GetPrimaryFrameForFocusNode(nsIFrame **aReturnFrame)
//select all content children of aContent
NS_IMETHODIMP
nsDOMSelection::selectFrames(nsIContentIterator *aInnerIter, nsIContent *aContent, nsIDOMRange *aRange, PRBool aFlags)
nsDOMSelection::selectFrames(nsIPresContext* aPresContext,
nsIContentIterator *aInnerIter,
nsIContent *aContent,
nsIDOMRange *aRange,
PRBool aFlags)
{
nsresult result = aInnerIter->Init(aContent);
nsIFrame *frame;
@ -1857,7 +1862,7 @@ nsDOMSelection::selectFrames(nsIContentIterator *aInnerIter, nsIContent *aConten
continue;
result = mRangeList->GetTracker()->GetPrimaryFrameFor(innercontent, &frame);
if (NS_SUCCEEDED(result) && frame)
frame->SetSelected(aRange,aFlags,eSpreadDown);//spread from here to hit all frames in flow
frame->SetSelected(aPresContext, aRange,aFlags,eSpreadDown);//spread from here to hit all frames in flow
result = aInnerIter->Next();
if (NS_FAILED(result))
return result;
@ -1876,7 +1881,7 @@ nsDOMSelection::selectFrames(nsIContentIterator *aInnerIter, nsIContent *aConten
//the idea of this helper method is to select, deselect "top to bottom" traversing through the frames
NS_IMETHODIMP
nsDOMSelection::selectFrames(nsIDOMRange *aRange, PRBool aFlags)
nsDOMSelection::selectFrames(nsIPresContext* aPresContext, nsIDOMRange *aRange, PRBool aFlags)
{
if (!aRange)
return NS_ERROR_NULL_POINTER;
@ -1909,7 +1914,7 @@ nsDOMSelection::selectFrames(nsIDOMRange *aRange, PRBool aFlags)
{
result = mRangeList->GetTracker()->GetPrimaryFrameFor(content, &frame);
if (NS_SUCCEEDED(result) && frame)
frame->SetSelected(aRange,aFlags,eSpreadDown);//spread from here to hit all frames in flow
frame->SetSelected(aPresContext, aRange,aFlags,eSpreadDown);//spread from here to hit all frames in flow
}
//end start content
result = iter->First();
@ -1918,7 +1923,7 @@ nsDOMSelection::selectFrames(nsIDOMRange *aRange, PRBool aFlags)
result = iter->CurrentNode(getter_AddRefs(content));
if (NS_FAILED(result) || !content)
return result;
selectFrames(inneriter, content, aRange, aFlags);
selectFrames(aPresContext, inneriter, content, aRange, aFlags);
result = iter->Next();
}
//we must now do the last one if it is not the same as the first
@ -1933,7 +1938,7 @@ nsDOMSelection::selectFrames(nsIDOMRange *aRange, PRBool aFlags)
{
result = mRangeList->GetTracker()->GetPrimaryFrameFor(content, &frame);
if (NS_SUCCEEDED(result) && frame)
frame->SetSelected(aRange,aFlags,eSpreadDown);//spread from here to hit all frames in flow
frame->SetSelected(aPresContext, aRange,aFlags,eSpreadDown);//spread from here to hit all frames in flow
}
}
//end end parent
@ -2068,7 +2073,7 @@ nsDOMSelection::LookUpSelection(nsIContent *aContent, PRInt32 aContentOffset, PR
}
NS_IMETHODIMP
nsDOMSelection::Repaint()
nsDOMSelection::Repaint(nsIPresContext* aPresContext)
{
PRUint32 arrCount = 0;
@ -2103,7 +2108,7 @@ nsDOMSelection::Repaint()
if (!range)
return NS_ERROR_NULL_POINTER;
result = selectFrames(range, PR_TRUE);
result = selectFrames(aPresContext, range, PR_TRUE);
if (NS_FAILED(result))
return result;
@ -2211,7 +2216,7 @@ nsDOMSelection::DoAutoScroll(nsIPresContext *aPresContext, nsIFrame *aFrame, nsP
while (NS_SUCCEEDED(result) && parentFrame && !frameView)
{
result = parentFrame->GetView(&frameView);
result = parentFrame->GetView(aPresContext, &frameView);
if (NS_SUCCEEDED(result) && !frameView)
result = parentFrame->GetParent(&parentFrame);
}
@ -2369,7 +2374,10 @@ nsDOMSelection::GetEnumerator(nsIEnumerator **aIterator)
NS_IMETHODIMP
nsDOMSelection::ClearSelection()
{
nsresult result = Clear();
nsCOMPtr<nsIPresContext> presContext;
GetPresContext(getter_AddRefs(presContext));
nsresult result = Clear(presContext);
if (NS_FAILED(result))
return result;
@ -2398,7 +2406,9 @@ nsDOMSelection::AddRange(nsIDOMRange* aRange)
return NS_ERROR_FAILURE;
}
setAnchorFocusRange(count -1);
selectFrames(aRange, PR_TRUE);
nsCOMPtr<nsIPresContext> presContext;
GetPresContext(getter_AddRefs(presContext));
selectFrames(presContext, aRange, PR_TRUE);
ScrollIntoView();
return mRangeList->NotifySelectionListeners();
@ -2418,7 +2428,9 @@ nsDOMSelection::Collapse(nsIDOMNode* aParentNode, PRInt32 aOffset)
// Delete all of the current ranges
if (NS_FAILED(SetOriginalAnchorPoint(aParentNode,aOffset)))
return NS_ERROR_FAILURE; //???
Clear();
nsCOMPtr<nsIPresContext> presContext;
GetPresContext(getter_AddRefs(presContext));
Clear(presContext);
nsCOMPtr<nsIDOMRange> range;
result = nsComponentManager::CreateInstance(kRangeCID, nsnull,
@ -2464,7 +2476,7 @@ nsDOMSelection::Collapse(nsIDOMNode* aParentNode, PRInt32 aOffset)
result = AddItem(range);
setAnchorFocusRange(0);
selectFrames(range,PR_TRUE);
selectFrames(presContext, range,PR_TRUE);
if (NS_FAILED(result))
return result;
@ -2996,6 +3008,8 @@ nsDOMSelection::Extend(nsIDOMNode* aParentNode, PRInt32 aOffset)
if (result2 == 0) //not selecting anywhere
return NS_OK;
nsCOMPtr<nsIPresContext> presContext;
GetPresContext(getter_AddRefs(presContext));
if ((result1 == 0 && result3 < 0) || (result1 <= 0 && result2 < 0)){//a1,2 a,1,2
//select from 1 to 2 unless they are collapsed
res = range->SetEnd(aParentNode,aOffset);
@ -3019,7 +3033,7 @@ nsDOMSelection::Extend(nsIDOMNode* aParentNode, PRInt32 aOffset)
#endif
}
else{
selectFrames(difRange , PR_TRUE);
selectFrames(presContext, difRange , PR_TRUE);
}
}
else if (result1 == 0 && result3 > 0){//2, a1
@ -3039,7 +3053,7 @@ nsDOMSelection::Extend(nsIDOMNode* aParentNode, PRInt32 aOffset)
}
else
#endif
selectFrames(range, PR_TRUE);
selectFrames(presContext, range, PR_TRUE);
}
else if (result3 <= 0 && result2 >= 0) {//a,2,1 or a2,1 or a,21 or a21
//deselect from 2 to 1
@ -3066,9 +3080,9 @@ nsDOMSelection::Extend(nsIDOMNode* aParentNode, PRInt32 aOffset)
}
else
{
selectFrames(difRange, 0);//deselect now if fixup succeeded
selectFrames(presContext, difRange, 0);//deselect now if fixup succeeded
difRange->SetEnd(FetchEndParent(range),FetchEndOffset(range));
selectFrames(difRange, PR_TRUE);//must reselect last node maybe more if fixup did something
selectFrames(presContext, difRange, PR_TRUE);//must reselect last node maybe more if fixup did something
}
}
else if (result1 >= 0 && result3 <= 0) {//1,a,2 or 1a,2 or 1,a2 or 1a2
@ -3100,10 +3114,10 @@ nsDOMSelection::Extend(nsIDOMNode* aParentNode, PRInt32 aOffset)
if (NS_FAILED(res))
return res;
//deselect from 1 to a
selectFrames(difRange , PR_FALSE);
selectFrames(presContext, difRange , PR_FALSE);
}
//select from a to 2
selectFrames(range , PR_TRUE);
selectFrames(presContext, range , PR_TRUE);
}
}
else if (result2 <= 0 && result3 >= 0) {//1,2,a or 12,a or 1,2a or 12a
@ -3131,9 +3145,9 @@ nsDOMSelection::Extend(nsIDOMNode* aParentNode, PRInt32 aOffset)
}
else
{
selectFrames(difRange , PR_FALSE);
selectFrames(presContext, difRange , PR_FALSE);
difRange->SetStart(FetchStartParent(range),FetchStartOffset(range));
selectFrames(difRange, PR_TRUE);//must reselect last node
selectFrames(presContext, difRange, PR_TRUE);//must reselect last node
}
}
else if (result3 >= 0 && result1 <= 0) {//2,a,1 or 2a,1 or 2,a1 or 2a1
@ -3160,10 +3174,10 @@ nsDOMSelection::Extend(nsIDOMNode* aParentNode, PRInt32 aOffset)
if (FetchFocusNode() != FetchAnchorNode() || FetchFocusOffset() != FetchAnchorOffset() ){//if collapsed diff dont do anything
res = difRange->SetStart(FetchAnchorNode(), FetchAnchorOffset());
res |= difRange->SetEnd(FetchFocusNode(), FetchFocusOffset());
selectFrames(difRange, 0);
selectFrames(presContext, difRange, 0);
}
//select from 2 to a
selectFrames(range , PR_TRUE);
selectFrames(presContext, range , PR_TRUE);
}
}
else if (result2 >= 0 && result1 >= 0) {//2,1,a or 21,a or 2,1a or 21a
@ -3190,7 +3204,7 @@ nsDOMSelection::Extend(nsIDOMNode* aParentNode, PRInt32 aOffset)
#endif
}
else {
selectFrames(difRange, PR_TRUE);
selectFrames(presContext, difRange, PR_TRUE);
}
}
@ -3303,6 +3317,19 @@ nsDOMSelection::ContainsNode(nsIDOMNode* aNode, PRBool aRecursive, PRBool* aYes)
return NS_OK;
}
nsresult
nsDOMSelection::GetPresContext(nsIPresContext **aPresContext)
{
nsresult rv = NS_OK;
nsIFocusTracker *tracker = mRangeList->GetTracker();
if (!tracker)
return NS_ERROR_NULL_POINTER;
return tracker->GetPresContext(aPresContext);
}
nsresult
nsDOMSelection::GetPresShell(nsIPresShell **aPresShell)
{
@ -3396,7 +3423,14 @@ nsDOMSelection::GetFrameToRootViewOffset(nsIFrame *aFrame, nscoord *aX, nscoord
// Determine the offset from aFrame to the scrolled view. We do that by
// getting the offset from its closest view and then walking up
scrollingView->GetScrolledView(scrolledView);
aFrame->GetOffsetFromView(offset, &closestView);
nsIFocusTracker *tracker = mRangeList->GetTracker();
if (!tracker)
return NS_ERROR_NULL_POINTER;
nsCOMPtr<nsIPresContext> presContext;
tracker->GetPresContext(getter_AddRefs(presContext));
aFrame->GetOffsetFromView(presContext, offset, &closestView);
// XXX Deal with the case where there is a scrolled element, e.g., a
// DIV in the middle...
@ -3466,7 +3500,7 @@ nsDOMSelection::GetPointFromOffset(nsIFrame *aFrame, PRInt32 aContentOffset, nsP
nsIView *closestView = 0;
nsPoint offset(0, 0);
rv = aFrame->GetOffsetFromView(offset, &closestView);
rv = aFrame->GetOffsetFromView(presContext, offset, &closestView);
while (!widget && closestView)
{

Просмотреть файл

@ -648,7 +648,7 @@ nsEventStateManager::UpdateCursor(nsIPresContext& aPresContext, nsPoint& aPoint,
}
nsIWidget* window;
aTargetFrame->GetWindow(&window);
aTargetFrame->GetWindow(&aPresContext, &window);
window->SetCursor(c);
NS_RELEASE(window);
}
@ -1378,7 +1378,7 @@ nsEventStateManager::SetContentState(nsIContent *aContent, PRInt32 aState)
}
if ((aState & NS_EVENT_STATE_FOCUS) && (aContent != mCurrentFocus)) {
SendFocusBlur(aContent);
SendFocusBlur(mPresContext, aContent);
//transferring ref to notifyContent from mCurrentFocus
notifyContent[3] = mCurrentFocus;
@ -1468,7 +1468,7 @@ nsEventStateManager::SetContentState(nsIContent *aContent, PRInt32 aState)
}
NS_IMETHODIMP
nsEventStateManager::SendFocusBlur(nsIContent *aContent)
nsEventStateManager::SendFocusBlur(nsIPresContext* aPresContext, nsIContent *aContent)
{
if (mCurrentFocus == aContent) {
return NS_OK;
@ -1543,7 +1543,7 @@ nsEventStateManager::SendFocusBlur(nsIContent *aContent)
PRBool shouldSetFocusOnWindow = PR_TRUE;
if (nsnull != currentFocusFrame) {
nsIView * view = nsnull;
currentFocusFrame->GetView(&view);
currentFocusFrame->GetView(aPresContext, &view);
if (view != nsnull) {
nsIWidget *window = nsnull;
view->GetWidget(window);
@ -1563,10 +1563,10 @@ nsEventStateManager::SendFocusBlur(nsIContent *aContent)
// then click on a gfx control (generates another focus event)
if (shouldSetFocusOnWindow && nsnull != currentFocusFrame) {
nsIFrame * parentFrame;
currentFocusFrame->GetParentWithView(&parentFrame);
currentFocusFrame->GetParentWithView(aPresContext, &parentFrame);
if (nsnull != parentFrame) {
nsIView * pView;
parentFrame->GetView(&pView);
parentFrame->GetView(aPresContext, &pView);
if (nsnull != pView) {
nsIWidget *window = nsnull;

Просмотреть файл

@ -72,7 +72,7 @@ protected:
void ShiftFocus(PRBool foward);
nsIContent* GetNextTabbableContent(nsIContent* aParent, nsIContent* aChild, nsIContent* aTop, PRBool foward);
PRInt32 GetNextTabIndex(nsIContent* aParent, PRBool foward);
NS_IMETHOD SendFocusBlur(nsIContent *aContent);
NS_IMETHOD SendFocusBlur(nsIPresContext* aPresContext, nsIContent *aContent);
nsIScrollableView* GetNearestScrollingView(nsIView* aView);
// routines for the d&d gesture tracking state machine

Просмотреть файл

@ -95,13 +95,13 @@ nsButtonFrameRenderer::isDisabled()
}
void
nsButtonFrameRenderer::Redraw()
nsButtonFrameRenderer::Redraw(nsIPresContext* aPresContext)
{
nsRect rect;
mFrame->GetRect(rect);
rect.x = 0;
rect.y = 0;
mFrame->Invalidate(rect, PR_FALSE);
mFrame->Invalidate(aPresContext, rect, PR_FALSE);
}
void

Просмотреть файл

@ -87,7 +87,7 @@ public:
virtual nsresult SetStyleContext(PRInt32 aIndex, nsIStyleContext* aStyleContext);
virtual void ReResolveStyles(nsIPresContext& aPresContext);
virtual void Redraw();
virtual void Redraw(nsIPresContext* aPresContext);
virtual nsIFrame* GetFrame();
virtual PRInt32 GetNameSpace();

Просмотреть файл

@ -189,7 +189,7 @@ nsComboboxControlFrame::IsSuccessful(nsIFormControlFrame* aSubmitter)
// This is a UI decision that goes against the HTML 4 spec.
// See bugzilla bug 15841 for justification of this deviation.
nsresult
nsComboboxControlFrame::MakeSureSomethingIsSelected()
nsComboboxControlFrame::MakeSureSomethingIsSelected(nsIPresContext* aPresContext)
{
nsIFormControlFrame* fcFrame = nsnull;
nsIFrame* dropdownFrame = GetDropdownFrame();
@ -203,7 +203,7 @@ nsComboboxControlFrame::MakeSureSomethingIsSelected()
mListControlFrame->GetNumberOfOptions(&length);
if (length > 0) {
// Set listbox selection to first item in the list box
rv = fcFrame->SetProperty(nsHTMLAtoms::selectedindex, "0");
rv = fcFrame->SetProperty(aPresContext, nsHTMLAtoms::selectedindex, "0");
mSelectedIndex = 0;
}
UpdateSelection(PR_FALSE, PR_TRUE, mSelectedIndex); // Needed to reflow when removing last option
@ -217,9 +217,9 @@ nsComboboxControlFrame::MakeSureSomethingIsSelected()
// Initialize the text string in the combobox using either the current
// selection in the list box or the first item item in the list box.
void
nsComboboxControlFrame::InitTextStr(PRBool aUpdate)
nsComboboxControlFrame::InitTextStr(nsIPresContext* aPresContext, PRBool aUpdate)
{
MakeSureSomethingIsSelected();
MakeSureSomethingIsSelected(aPresContext);
// Update the selected text string
mListControlFrame->GetSelectedItem(mTextStr);
@ -235,18 +235,18 @@ nsComboboxControlFrame::InitTextStr(PRBool aUpdate)
// Reset the combo box back to it original state.
void
nsComboboxControlFrame::Reset()
nsComboboxControlFrame::Reset(nsIPresContext* aPresContext)
{
// Reset the dropdown list to its original state
nsIFormControlFrame* fcFrame = nsnull;
nsIFrame* dropdownFrame = GetDropdownFrame();
nsresult result = dropdownFrame->QueryInterface(kIFormControlFrameIID, (void**)&fcFrame);
if ((NS_OK == result) && (nsnull != fcFrame)) {
fcFrame->Reset();
fcFrame->Reset(aPresContext);
}
// Update the combobox using the text string returned from the dropdown list
InitTextStr(PR_TRUE);
InitTextStr(aPresContext, PR_TRUE);
}
void
@ -254,7 +254,7 @@ nsComboboxControlFrame::PostCreateWidget(nsIPresContext* aPresContext,
nscoord& aWidth,
nscoord& aHeight)
{
Reset();
Reset(aPresContext);
}
//--------------------------------------------------------------
@ -370,7 +370,7 @@ nsComboboxControlFrame::ShowList(nsIPresContext* aPresContext, PRBool aShowList)
nsIFrame * listFrame;
if (NS_OK == mListControlFrame->QueryInterface(kIFrameIID, (void **)&listFrame)) {
nsIView * view = nsnull;
listFrame->GetView(&view);
listFrame->GetView(aPresContext, &view);
NS_ASSERTION(view != nsnull, "nsComboboxControlFrame view is null");
view->GetWidget(widget);
if (nsnull != widget) {
@ -385,7 +385,7 @@ nsComboboxControlFrame::ShowList(nsIPresContext* aPresContext, PRBool aShowList)
// The listcontrol frame will call back to the nsComboboxControlFrame's ListWasSelected
// which will stop the capture.
mListControlFrame->AboutToDropDown();
mListControlFrame->CaptureMouseEvents(PR_TRUE);
mListControlFrame->CaptureMouseEvents(aPresContext, PR_TRUE);
} else {
ShowPopup(PR_FALSE);
mDroppedDown = PR_FALSE;
@ -427,7 +427,7 @@ nsComboboxControlFrame::ReflowComboChildFrame(nsIFrame* aFrame,
aFrame->GetRect(rect);
rect.width = aDesiredSize.width;
rect.height = aDesiredSize.height;
aFrame->SetRect(rect);
aFrame->SetRect(&aPresContext, rect);
return rv;
}
@ -557,7 +557,7 @@ nsComboboxControlFrame::PositionDropdown(nsIPresContext& aPresContext,
dropdownFrame->GetRect(currentRect);
//if (currentRect != dropdownRect) {
dropdownFrame->SetRect(dropdownRect);
dropdownFrame->SetRect(&aPresContext, dropdownRect);
#ifdef DEBUG_rodsXXX
printf("%d Position Dropdown at: %d %d %d %d\n", counter++, dropdownRect.x, dropdownRect.y, dropdownRect.width, dropdownRect.height);
#endif
@ -593,7 +593,7 @@ nsComboboxControlFrame::GetAbsoluteFramePosition(nsIPresContext& aPresContext,
// Add in frame's offset from it it's containing view
nsIView *containingView = nsnull;
nsPoint offset;
rv = aFrame->GetOffsetFromView(offset, &containingView);
rv = aFrame->GetOffsetFromView(&aPresContext, offset, &containingView);
if (NS_SUCCEEDED(rv) && (nsnull != containingView)) {
aAbsoluteTwipsRect.x += offset.x;
aAbsoluteTwipsRect.y += offset.y;
@ -760,7 +760,7 @@ nsComboboxControlFrame::Reflow(nsIPresContext& aPresContext,
buttonFrame->GetRect(buttonRect);
buttonRect.y = displayRect.y;
buttonRect.height = displayRect.height;
buttonFrame->SetRect(buttonRect);
buttonFrame->SetRect(&aPresContext, buttonRect);
// Reflow the dropdown list to match the width of the display + button
ReflowComboChildFrame(dropdownFrame, aPresContext, dropdownDesiredSize, firstPassState, aStatus, aDesiredSize.width, NS_UNCONSTRAINEDSIZE);
@ -871,13 +871,15 @@ nsComboboxControlFrame::GetNamesValues(PRInt32 aMaxNumValues, PRInt32& aNumValue
}
NS_IMETHODIMP
nsComboboxControlFrame::GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame)
nsComboboxControlFrame::GetFrameForPoint(nsIPresContext* aPresContext,
const nsPoint& aPoint,
nsIFrame** aFrame)
{
if (nsFormFrame::GetDisabled(this)) {
*aFrame = this;
return NS_OK;
} else {
return nsHTMLContainerFrame::GetFrameForPoint(aPoint, aFrame);
return nsHTMLContainerFrame::GetFrameForPoint(aPresContext, aPoint, aFrame);
}
return NS_OK;
}
@ -921,7 +923,7 @@ nsComboboxControlFrame::ShowDropDown(PRBool aDoDropDown)
if (!mDroppedDown && aDoDropDown) {
if (mListControlFrame) {
mListControlFrame->SyncViewWithFrame();
mListControlFrame->SyncViewWithFrame(mPresContext);
}
ToggleList(mPresContext);
return NS_OK;
@ -964,7 +966,7 @@ nsComboboxControlFrame::ListWasSelected(nsIPresContext* aPresContext)
aPresContext = mPresContext;
}
ShowList(aPresContext, PR_FALSE);
mListControlFrame->CaptureMouseEvents(PR_FALSE);
mListControlFrame->CaptureMouseEvents(aPresContext, PR_FALSE);
PRInt32 indx;
mListControlFrame->GetSelectedIndex(&indx);
@ -1059,36 +1061,36 @@ nsComboboxControlFrame::SelectionChanged()
//----------------------------------------------------------------------
NS_IMETHODIMP
nsComboboxControlFrame::AddOption(PRInt32 aIndex)
nsComboboxControlFrame::AddOption(nsIPresContext* aPresContext, PRInt32 aIndex)
{
nsISelectControlFrame* listFrame = nsnull;
nsIFrame* dropdownFrame = GetDropdownFrame();
nsresult rv = dropdownFrame->QueryInterface(NS_GET_IID(nsISelectControlFrame),
(void**)&listFrame);
if (NS_SUCCEEDED(rv) && listFrame) {
rv = listFrame->AddOption(aIndex);
rv = listFrame->AddOption(aPresContext, aIndex);
NS_RELEASE(listFrame);
}
// If we added the first option, we might need to select it.
MakeSureSomethingIsSelected();
MakeSureSomethingIsSelected(aPresContext);
return rv;
}
NS_IMETHODIMP
nsComboboxControlFrame::RemoveOption(PRInt32 aIndex)
nsComboboxControlFrame::RemoveOption(nsIPresContext* aPresContext, PRInt32 aIndex)
{
nsISelectControlFrame* listFrame = nsnull;
nsIFrame* dropdownFrame = GetDropdownFrame();
nsresult rv = dropdownFrame->QueryInterface(NS_GET_IID(nsISelectControlFrame),
(void**)&listFrame);
if (NS_SUCCEEDED(rv) && listFrame) {
rv = listFrame->RemoveOption(aIndex);
rv = listFrame->RemoveOption(aPresContext, aIndex);
NS_RELEASE(listFrame);
}
// If we removed the selected option, nothing is selected any more.
// Restore selection to option 0 if there are options left.
MakeSureSomethingIsSelected();
MakeSureSomethingIsSelected(aPresContext);
return rv;
}
@ -1145,13 +1147,13 @@ nsComboboxControlFrame::RequiresWidget(PRBool& aRequiresWidget)
NS_IMETHODIMP
nsComboboxControlFrame::SetProperty(nsIAtom* aName, const nsString& aValue)
nsComboboxControlFrame::SetProperty(nsIPresContext* aPresContext, nsIAtom* aName, const nsString& aValue)
{
nsIFormControlFrame* fcFrame = nsnull;
nsIFrame* dropdownFrame = GetDropdownFrame();
nsresult result = dropdownFrame->QueryInterface(kIFormControlFrameIID, (void**)&fcFrame);
if ((NS_SUCCEEDED(result)) && (nsnull != fcFrame)) {
return fcFrame->SetProperty(aName, aValue);
return fcFrame->SetProperty(aPresContext, aName, aValue);
}
return result;
}
@ -1269,7 +1271,7 @@ nsComboboxControlFrame::SetInitialChildList(nsIPresContext& aPresContext,
mPopupFrames.SetFrames(aChildList);
} else {
rv = nsAreaFrame::SetInitialChildList(aPresContext, aListName, aChildList);
InitTextStr(PR_FALSE);
InitTextStr(&aPresContext, PR_FALSE);
}
return rv;
}
@ -1319,7 +1321,7 @@ nsComboboxControlFrame::Rollup()
if (mDroppedDown) {
mListControlFrame->AboutToRollup();
ShowDropDown(PR_FALSE);
mListControlFrame->CaptureMouseEvents(PR_FALSE);
mListControlFrame->CaptureMouseEvents(mPresContext, PR_FALSE);
}
return NS_OK;
}
@ -1330,35 +1332,36 @@ nsComboboxControlFrame::Rollup()
// the ListControlFrame, our child...
//----------------------------------------------------------------------
NS_IMETHODIMP
nsComboboxControlFrame::GetStateType(nsIStatefulFrame::StateType* aStateType)
nsComboboxControlFrame::GetStateType(nsIPresContext* aPresContext,
nsIStatefulFrame::StateType* aStateType)
{
*aStateType = nsIStatefulFrame::eSelectType;
return NS_OK;
}
NS_IMETHODIMP
nsComboboxControlFrame::SaveState(nsISupports** aState)
nsComboboxControlFrame::SaveState(nsIPresContext* aPresContext, nsISupports** aState)
{
if (!mListControlFrame) return NS_ERROR_UNEXPECTED;
nsIStatefulFrame* sFrame = nsnull;
nsresult res = mListControlFrame->QueryInterface(NS_GET_IID(nsIStatefulFrame),
(void**)&sFrame);
if (NS_SUCCEEDED(res) && sFrame) {
res = sFrame->SaveState(aState);
res = sFrame->SaveState(aPresContext, aState);
NS_RELEASE(sFrame);
}
return res;
}
NS_IMETHODIMP
nsComboboxControlFrame::RestoreState(nsISupports* aState)
nsComboboxControlFrame::RestoreState(nsIPresContext* aPresContext, nsISupports* aState)
{
if (!mListControlFrame) return NS_ERROR_UNEXPECTED;
nsIStatefulFrame* sFrame = nsnull;
nsresult res = mListControlFrame->QueryInterface(NS_GET_IID(nsIStatefulFrame),
(void**)&sFrame);
if (NS_SUCCEEDED(res) && sFrame) {
res = sFrame->RestoreState(aState);
res = sFrame->RestoreState(aPresContext, aState);
NS_RELEASE(sFrame);
}
return res;

Просмотреть файл

@ -88,13 +88,13 @@ public:
NS_IMETHOD GetAdditionalChildListName(PRInt32 aIndex,
nsIAtom** aListName) const;
NS_IMETHOD GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame);
NS_IMETHOD GetFrameForPoint(nsIPresContext* aPresContext, const nsPoint& aPoint, nsIFrame** aFrame);
// nsIFormControlFrame
NS_IMETHOD SetSuggestedSize(nscoord aWidth, nscoord aHeight);
NS_IMETHOD GetName(nsString* aName);
NS_IMETHOD GetType(PRInt32* aType) const;
NS_IMETHOD SetProperty(nsIAtom* aName, const nsString& aValue);
NS_IMETHOD SetProperty(nsIPresContext* aPresContext, nsIAtom* aName, const nsString& aValue);
NS_IMETHOD GetProperty(nsIAtom* aName, nsString& aValue);
void SetFocus(PRBool aOn, PRBool aRepaint);
void ScrollIntoView(nsIPresContext* aPresContext);
@ -103,7 +103,7 @@ public:
nscoord& aHeight);
virtual PRBool IsSuccessful(nsIFormControlFrame* aSubmitter);
virtual void SetFormFrame(nsFormFrame* aFormFrame) { mFormFrame = aFormFrame; }
virtual void Reset();
virtual void Reset(nsIPresContext* aPresContext);
virtual PRInt32 GetMaxNumValues();
virtual PRBool GetNamesValues(PRInt32 aMaxNumValues, PRInt32& aNumValues,
nsString* aValues, nsString* aNames);
@ -139,8 +139,8 @@ public:
NS_IMETHOD GetAbsoluteRect(nsRect* aRect);
// nsISelectControlFrame
NS_IMETHOD AddOption(PRInt32 index);
NS_IMETHOD RemoveOption(PRInt32 index);
NS_IMETHOD AddOption(nsIPresContext* aPresContext, PRInt32 index);
NS_IMETHOD RemoveOption(nsIPresContext* aPresContext, PRInt32 index);
NS_IMETHOD SetOptionSelected(PRInt32 aIndex, PRBool aValue);
NS_IMETHOD GetOptionSelected(PRInt32 aIndex, PRBool* aValue);
@ -154,9 +154,9 @@ public:
virtual nsresult HandleEvent(nsIDOMEvent* aEvent) { return NS_OK; }
//nsIStatefulFrame
NS_IMETHOD GetStateType(StateType* aStateType);
NS_IMETHOD SaveState(nsISupports** aState);
NS_IMETHOD RestoreState(nsISupports* aState);
NS_IMETHOD GetStateType(nsIPresContext* aPresContext, StateType* aStateType);
NS_IMETHOD SaveState(nsIPresContext* aPresContext, nsISupports** aState);
NS_IMETHOD RestoreState(nsIPresContext* aPresContext, nsISupports* aState);
//nsIRollupListener
NS_IMETHOD Rollup();
@ -191,12 +191,12 @@ protected:
void ShowPopup(PRBool aShowPopup);
void ShowList(nsIPresContext* aPresContext, PRBool aShowList);
void SetChildFrameSize(nsIFrame* aFrame, nscoord aWidth, nscoord aHeight);
void InitTextStr(PRBool aUpdate);
void InitTextStr(nsIPresContext* aPresContext, PRBool aUpdate);
nsresult GetPrimaryComboFrame(nsIPresContext& aPresContext, nsIContent* aContent, nsIFrame** aFrame);
nsIFrame* GetButtonFrame(nsIPresContext& aPresContext);
nsIFrame* GetDropdownFrame();
NS_IMETHOD ToggleList(nsIPresContext* aPresContext);
nsresult MakeSureSomethingIsSelected(); // Default to option 0
nsresult MakeSureSomethingIsSelected(nsIPresContext* aPresContext); // Default to option 0
nsFrameList mPopupFrames; // additional named child list
nsIPresContext* mPresContext; // XXX: Remove the need to cache the pres context.

Просмотреть файл

@ -271,7 +271,7 @@ nsFieldSetFrame::Paint(nsIPresContext& aPresContext,
if ((NS_FRAME_PAINT_LAYER_DEBUG == aWhichLayer) && GetShowFrameBorders()) {
nsIView* view;
GetView(&view);
GetView(&aPresContext, &view);
if (nsnull != view) {
aRenderingContext.SetColor(NS_RGB(0,0,255));
}
@ -359,7 +359,7 @@ nsFieldSetFrame::Reflow(nsIPresContext& aPresContext,
nsRect contentRect(borderPadding.left,borderPadding.top + mLegendSpace,aDesiredSize.width ,aDesiredSize.height);
// Place the content area frame.
mContentFrame->SetRect(contentRect);
mContentFrame->SetRect(&aPresContext, contentRect);
if (mLegendFrame)
{
@ -376,7 +376,7 @@ nsFieldSetFrame::Reflow(nsIPresContext& aPresContext,
// place the legend
nsRect actualLegendRect(mLegendRect);
actualLegendRect.Deflate(legendMargin);
mLegendFrame->SetRect(actualLegendRect);
mLegendFrame->SetRect(&aPresContext, actualLegendRect);
}
// Return our size and our result

Просмотреть файл

@ -161,7 +161,7 @@ nsFileControlFrame::IsSuccessful(nsIFormControlFrame* aSubmitter)
}
void
nsFileControlFrame::Reset()
nsFileControlFrame::Reset(nsIPresContext* aPresContext)
{
if (mTextFrame) {
mTextFrame->Reset();
@ -221,7 +221,7 @@ nsresult
nsFileControlFrame::MouseClick(nsIDOMEvent* aMouseEvent)
{
nsIView* textView;
mTextFrame->GetView(&textView);
mTextFrame->GetView(mPresContext, &textView);
if (nsnull == textView) {
return NS_OK;
}
@ -249,7 +249,7 @@ nsFileControlFrame::MouseClick(nsIDOMEvent* aMouseEvent)
fileWidget->GetFile(fileSpec);
char* leafName = fileSpec.GetLeafName();
if (leafName) {
mTextFrame->SetProperty(nsHTMLAtoms::value,leafName);
mTextFrame->SetProperty(mPresContext, nsHTMLAtoms::value,leafName);
nsCRT::free(leafName);
}
}
@ -272,7 +272,7 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext& aPresContext,
mTextFrame = GetTextControlFrame(this);
if (!mTextFrame) return NS_ERROR_UNEXPECTED;
if (mCachedState) {
mTextFrame->SetProperty(nsHTMLAtoms::value, *mCachedState);
mTextFrame->SetProperty(&aPresContext, nsHTMLAtoms::value, *mCachedState);
delete mCachedState;
mCachedState = nsnull;
}
@ -414,13 +414,15 @@ nsFileControlFrame::AttributeChanged(nsIPresContext* aPresContext,
}
NS_IMETHODIMP
nsFileControlFrame::GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame)
nsFileControlFrame::GetFrameForPoint(nsIPresContext* aPresContext,
const nsPoint& aPoint,
nsIFrame** aFrame)
{
if (nsFormFrame::GetDisabled(this)) {
*aFrame = this;
return NS_OK;
} else {
return nsAreaFrame::GetFrameForPoint(aPoint, aFrame);
return nsAreaFrame::GetFrameForPoint(aPresContext, aPoint, aFrame);
}
return NS_OK;
}
@ -473,7 +475,9 @@ nsresult nsFileControlFrame::RequiresWidget(PRBool& aRequiresWidget)
}
NS_IMETHODIMP nsFileControlFrame::SetProperty(nsIAtom* aName, const nsString& aValue)
NS_IMETHODIMP nsFileControlFrame::SetProperty(nsIPresContext* aPresContext,
nsIAtom* aName,
const nsString& aValue)
{
nsresult rv = NS_OK;
if (nsHTMLAtoms::value == aName) {
@ -516,14 +520,14 @@ nsFileControlFrame::Paint(nsIPresContext& aPresContext,
// nsIStatefulFrame
//----------------------------------------------------------------------
NS_IMETHODIMP
nsFileControlFrame::GetStateType(nsIStatefulFrame::StateType* aStateType)
nsFileControlFrame::GetStateType(nsIPresContext* aPresContext, nsIStatefulFrame::StateType* aStateType)
{
*aStateType = nsIStatefulFrame::eFileType;
return NS_OK;
}
NS_IMETHODIMP
nsFileControlFrame::SaveState(nsISupports** aState)
nsFileControlFrame::SaveState(nsIPresContext* aPresContext, nsISupports** aState)
{
nsISupportsString* value = nsnull;
nsAutoString string;
@ -546,13 +550,13 @@ nsFileControlFrame::SaveState(nsISupports** aState)
}
NS_IMETHODIMP
nsFileControlFrame::RestoreState(nsISupports* aState)
nsFileControlFrame::RestoreState(nsIPresContext* aPresContext, nsISupports* aState)
{
char* chars = nsnull;
nsresult res = ((nsISupportsString*)aState)->GetData(&chars);
if (NS_SUCCEEDED(res) && chars) {
nsAutoString value(chars);
SetProperty(nsHTMLAtoms::value, value);
SetProperty(aPresContext, nsHTMLAtoms::value, value);
nsCRT::free(chars);
}
return res;

Просмотреть файл

@ -42,6 +42,16 @@ public:
nsFileControlFrame();
virtual ~nsFileControlFrame();
// XXX Hack so we can squirrel away the pres context pointer
NS_IMETHOD Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow) {
mPresContext = &aPresContext;
return nsAreaFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow);
}
virtual void MouseClicked(nsIPresContext* aPresContext) {}
virtual void SetFormFrame(nsFormFrame* aFormFrame) { mFormFrame = aFormFrame; }
virtual nsFormFrame* GetFromFrame() { return mFormFrame; }
@ -52,7 +62,7 @@ public:
nsFramePaintLayer aWhichLayer);
// nsIFormControlFrame
NS_IMETHOD SetProperty(nsIAtom* aName, const nsString& aValue);
NS_IMETHOD SetProperty(nsIPresContext* aPresContext, nsIAtom* aName, const nsString& aValue);
NS_IMETHOD GetProperty(nsIAtom* aName, nsString& aValue);
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
@ -63,7 +73,7 @@ public:
NS_IMETHOD GetFrameName(nsString& aResult) const;
NS_IMETHOD SetSuggestedSize(nscoord aWidth, nscoord aHeight) { return NS_OK; };
NS_IMETHOD GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame);
NS_IMETHOD GetFrameForPoint(nsIPresContext* aPresContext, const nsPoint& aPoint, nsIFrame** aFrame);
NS_IMETHOD AttributeChanged(nsIPresContext* aPresContext,
nsIContent* aChild,
PRInt32 aNameSpaceID,
@ -77,7 +87,7 @@ public:
NS_IMETHOD GetName(nsString* aName);
virtual PRBool IsSuccessful(nsIFormControlFrame* aSubmitter);
virtual void Reset();
virtual void Reset(nsIPresContext* aPresContext);
NS_IMETHOD GetType(PRInt32* aType) const;
void SetFocus(PRBool aOn, PRBool aRepaint);
void ScrollIntoView(nsIPresContext* aPresContext);
@ -149,9 +159,9 @@ public:
virtual nsresult HandleEvent(nsIDOMEvent* aEvent) { return NS_OK; }
//nsIStatefulFrame
NS_IMETHOD GetStateType(StateType* aStateType);
NS_IMETHOD SaveState(nsISupports** aState);
NS_IMETHOD RestoreState(nsISupports* aState);
NS_IMETHOD GetStateType(nsIPresContext* aPresContext, StateType* aStateType);
NS_IMETHOD SaveState(nsIPresContext* aPresContext, nsISupports** aState);
NS_IMETHOD RestoreState(nsIPresContext* aPresContext, nsISupports* aState);
protected:
nsIWidget* GetWindowTemp(nsIView *aView); // XXX temporary
@ -162,6 +172,8 @@ protected:
nsFormFrame* mFormFrame;
nsIHTMLContent* mTextContent;
nsString* mCachedState;
// XXX Hack: pres context needed by function MouseClick()
nsIPresContext* mPresContext; // weak reference
private:
nsTextControlFrame* GetTextControlFrame(nsIFrame* aStart);

Просмотреть файл

@ -199,7 +199,7 @@ nsFormControlFrame::DidReflow(nsIPresContext& aPresContext,
// positioned then we show it.
if (NS_FRAME_REFLOW_FINISHED == aStatus) {
nsIView* view = nsnull;
GetView(&view);
GetView(&aPresContext, &view);
if (view) {
const nsStyleDisplay* display;
GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)display));
@ -462,7 +462,7 @@ nsFormControlFrame::GetStyleSize(nsIPresContext& aPresContext,
}
void
nsFormControlFrame::Reset()
nsFormControlFrame::Reset(nsIPresContext* aPresContext)
{
}
@ -533,7 +533,7 @@ nsFormControlFrame::SetCurrentCheckState(PRBool aState)
}
NS_IMETHODIMP
nsFormControlFrame::SetProperty(nsIAtom* aName, const nsString& aValue)
nsFormControlFrame::SetProperty(nsIPresContext* aPresContext, nsIAtom* aName, const nsString& aValue)
{
return NS_OK;
}

Просмотреть файл

@ -156,7 +156,7 @@ public:
virtual void SetFocus(PRBool aOn = PR_TRUE, PRBool aRepaint = PR_FALSE);
virtual void ScrollIntoView(nsIPresContext* aPresContext);
virtual void Reset();
virtual void Reset(nsIPresContext* aPresContext);
virtual PRBool IsSuccessful(nsIFormControlFrame* aSubmitter);
/**
@ -203,7 +203,7 @@ public:
nsSize& aSize);
// nsIFormControlFrame
NS_IMETHOD SetProperty(nsIAtom* aName, const nsString& aValue);
NS_IMETHOD SetProperty(nsIPresContext* aPresContext, nsIAtom* aName, const nsString& aValue);
NS_IMETHOD GetProperty(nsIAtom* aName, nsString& aValue);
protected:

Просмотреть файл

@ -78,7 +78,7 @@ nsFormControlHelper::~nsFormControlHelper()
MOZ_COUNT_DTOR(nsFormControlHelper);
}
void nsFormControlHelper::ForceDrawFrame(nsIFrame * aFrame)
void nsFormControlHelper::ForceDrawFrame(nsIPresContext* aPresContext, nsIFrame * aFrame)
{
if (aFrame == nsnull) {
return;
@ -86,7 +86,7 @@ void nsFormControlHelper::ForceDrawFrame(nsIFrame * aFrame)
nsRect rect;
nsIView * view;
nsPoint pnt;
aFrame->GetOffsetFromView(pnt, &view);
aFrame->GetOffsetFromView(aPresContext, pnt, &view);
aFrame->GetRect(rect);
rect.x = pnt.x;
rect.y = pnt.y;

Просмотреть файл

@ -126,7 +126,7 @@ public:
nsInputDimensionSpec& aSpec,
nsSize& aSize);
static void ForceDrawFrame(nsIFrame * aFrame);
static void ForceDrawFrame(nsIPresContext* aPresContext, nsIFrame * aFrame);
static nsresult GetValue(nsIContent* aContent, nsString* aResult);
static nsresult GetName(nsIContent* aContent, nsString* aResult);

Просмотреть файл

@ -179,10 +179,11 @@ nsGfxCheckboxControlFrame :: GetCheckboxState ( )
}
void
nsGfxCheckboxControlFrame :: SetCheckboxState ( nsCheckboxControlFrame::CheckState aValue )
nsGfxCheckboxControlFrame :: SetCheckboxState (nsIPresContext* aPresContext,
nsCheckboxControlFrame::CheckState aValue )
{
mChecked = aValue;
nsFormControlHelper::ForceDrawFrame(this);
nsFormControlHelper::ForceDrawFrame(aPresContext, this);
}
#ifdef DEBUG_rods

Просмотреть файл

@ -45,7 +45,7 @@ public:
protected:
virtual CheckState GetCheckboxState();
virtual void SetCheckboxState(CheckState aValue);
virtual void SetCheckboxState(nsIPresContext* aPresContext, CheckState aValue);
virtual void PaintCheckBox(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,

Просмотреть файл

@ -163,10 +163,10 @@ PRBool nsGfxRadioControlFrame::GetRadioState()
return mChecked;
}
void nsGfxRadioControlFrame::SetRadioState(PRBool aValue)
void nsGfxRadioControlFrame::SetRadioState(nsIPresContext* aPresContext, PRBool aValue)
{
mChecked = aValue;
nsFormControlHelper::ForceDrawFrame(this);
nsFormControlHelper::ForceDrawFrame(aPresContext, this);
}
#ifdef DEBUG_rods

Просмотреть файл

@ -70,7 +70,7 @@ public:
protected:
virtual PRBool GetRadioState();
virtual void SetRadioState(PRBool aValue);
virtual void SetRadioState(nsIPresContext* aPresContext, PRBool aValue);
//GFX-rendered state variables
PRBool mChecked;

Просмотреть файл

@ -278,7 +278,7 @@ nsHTMLButtonControlFrame::MouseClicked(nsIPresContext* aPresContext)
formContent->HandleDOMEvent(*aPresContext, &event, nsnull, NS_EVENT_FLAG_INIT, status);
}
if (nsEventStatus_eConsumeNoDefault != status) {
mFormFrame->OnReset();
mFormFrame->OnReset(aPresContext);
}
}
else if (IsSubmit(type) == PR_TRUE) {
@ -314,11 +314,11 @@ nsHTMLButtonControlFrame::ScrollIntoView(nsIPresContext* aPresContext)
}
void
nsHTMLButtonControlFrame::GetTranslatedRect(nsRect& aRect)
nsHTMLButtonControlFrame::GetTranslatedRect(nsIPresContext* aPresContext, nsRect& aRect)
{
nsIView* view;
nsPoint viewOffset(0,0);
GetOffsetFromView(viewOffset, &view);
GetOffsetFromView(aPresContext, viewOffset, &view);
while (nsnull != view) {
nsPoint tempOffset;
view->GetPosition(&tempOffset.x, &tempOffset.y);
@ -353,7 +353,9 @@ nsHTMLButtonControlFrame::HandleEvent(nsIPresContext& aPresContext,
NS_IMETHODIMP
nsHTMLButtonControlFrame::GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame)
nsHTMLButtonControlFrame::GetFrameForPoint(nsIPresContext* aPresContext,
const nsPoint& aPoint,
nsIFrame** aFrame)
{
*aFrame = this;
return NS_OK;
@ -530,7 +532,7 @@ nsHTMLButtonControlFrame::Reflow(nsIPresContext& aPresContext,
// See if it's targeted at us
aReflowState.reflowCommand->GetTarget(targetFrame);
if (this == targetFrame) {
Invalidate(nsRect(0,0,mRect.width,mRect.height), PR_FALSE);
Invalidate(&aPresContext, nsRect(0,0,mRect.width,mRect.height), PR_FALSE);
nsIReflowCommand::ReflowType reflowType;
aReflowState.reflowCommand->GetType(reflowType);
@ -552,7 +554,7 @@ nsHTMLButtonControlFrame::Reflow(nsIPresContext& aPresContext,
// Place the child
nsRect rect = nsRect(focusPadding.left + aReflowState.mComputedBorderPadding.left, focusPadding.top + aReflowState.mComputedBorderPadding.top, aDesiredSize.width, aDesiredSize.height);
firstKid->SetRect(rect);
firstKid->SetRect(&aPresContext, rect);
// if computed use the computed values.
if (aReflowState.mComputedWidth != NS_INTRINSICSIZE && (aDesiredSize.width < aReflowState.mComputedWidth))
@ -631,7 +633,8 @@ nsresult nsHTMLButtonControlFrame::RequiresWidget(PRBool& aRequiresWidget)
}
NS_IMETHODIMP nsHTMLButtonControlFrame::SetProperty(nsIAtom* aName, const nsString& aValue)
NS_IMETHODIMP nsHTMLButtonControlFrame::SetProperty(nsIPresContext* aPresContext,
nsIAtom* aName, const nsString& aValue)
{
return NS_OK;
}

Просмотреть файл

@ -75,7 +75,7 @@ public:
nsGUIEvent* aEvent,
nsEventStatus& aEventStatus);
NS_IMETHOD GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame);
NS_IMETHOD GetFrameForPoint(nsIPresContext* aPresContext, const nsPoint& aPoint, nsIFrame** aFrame);
NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext,
nsIAtom* aListName,
@ -108,7 +108,7 @@ public:
virtual PRBool GetNamesValues(PRInt32 aMaxNumValues, PRInt32& aNumValues,
nsString* aValues, nsString* aNames);
virtual void MouseClicked(nsIPresContext* aPresContext);
virtual void Reset() {};
virtual void Reset(nsIPresContext*) {};
virtual void SetFormFrame(nsFormFrame* aFormFrame) { mFormFrame = aFormFrame; }
void SetFocus(PRBool aOn, PRBool aRepaint);
@ -129,7 +129,7 @@ public:
void GetDefaultLabel(nsString& aLabel);
// nsIFormControlFrame
NS_IMETHOD SetProperty(nsIAtom* aName, const nsString& aValue);
NS_IMETHOD SetProperty(nsIPresContext* aPresContext, nsIAtom* aName, const nsString& aValue);
NS_IMETHOD GetProperty(nsIAtom* aName, nsString& aValue);
NS_IMETHOD SetSuggestedSize(nscoord aWidth, nscoord aHeight);
@ -140,7 +140,7 @@ protected:
const nsHTMLReflowState& aSuggestedReflowState);
NS_IMETHOD_(nsrefcnt) AddRef(void);
NS_IMETHOD_(nsrefcnt) Release(void);
void GetTranslatedRect(nsRect& aRect);
void GetTranslatedRect(nsIPresContext* aPresContext, nsRect& aRect);
PRIntn GetSkipSides() const;
PRBool mInline;

Просмотреть файл

@ -52,7 +52,7 @@ public:
virtual void MouseClicked(nsIPresContext* aPresContext) = 0;
virtual void Reset() = 0;
virtual void Reset(nsIPresContext* aPresContext) = 0;
virtual PRBool IsSuccessful(nsIFormControlFrame* aSubmitter) = 0;
@ -118,7 +118,7 @@ public:
* @returns NS_OK if the property name is valid, otherwise an error code
*/
NS_IMETHOD SetProperty(nsIAtom* aName, const nsString& aValue) = 0;
NS_IMETHOD SetProperty(nsIPresContext* aPresContext, nsIAtom* aName, const nsString& aValue) = 0;
/**
* Get a property from the form control frame

Просмотреть файл

@ -62,7 +62,7 @@ public:
* Initiates mouse capture for the listbox
*
*/
NS_IMETHOD CaptureMouseEvents(PRBool aGrabMouseEvents) = 0;
NS_IMETHOD CaptureMouseEvents(nsIPresContext* aPresContext, PRBool aGrabMouseEvents) = 0;
/**
* Returns the maximum width and height of an item in the listbox
@ -79,7 +79,7 @@ public:
/**
*
*/
NS_IMETHOD SyncViewWithFrame() = 0;
NS_IMETHOD SyncViewWithFrame(nsIPresContext* aPresContext) = 0;
/**
*

Просмотреть файл

@ -39,13 +39,13 @@ public:
* Adds an option to the list at index
*/
NS_IMETHOD AddOption(PRInt32 index) = 0;
NS_IMETHOD AddOption(nsIPresContext* aPresContext, PRInt32 index) = 0;
/**
* Removes the option at index
*/
NS_IMETHOD RemoveOption(PRInt32 index) = 0;
NS_IMETHOD RemoveOption(nsIPresContext* aPresContext, PRInt32 index) = 0;
/**
* Sets the select state of the option at index

Просмотреть файл

@ -97,7 +97,7 @@ public:
NS_IMETHOD GetName(nsString* aName);
virtual void Reset() {};
virtual void Reset(nsIPresContext*) {};
void SetFocus(PRBool aOn, PRBool aRepaint);
void ScrollIntoView(nsIPresContext* aPresContext);
@ -117,12 +117,12 @@ public:
// nsIFormControlFrame
NS_IMETHOD SetProperty(nsIAtom* aName, const nsString& aValue);
NS_IMETHOD SetProperty(nsIPresContext* aPresContext, nsIAtom* aName, const nsString& aValue);
NS_IMETHOD GetProperty(nsIAtom* aName, nsString& aValue);
NS_IMETHOD SetSuggestedSize(nscoord aWidth, nscoord aHeight);
protected:
void GetTranslatedRect(nsRect& aRect); // XXX this implementation is a copy of nsHTMLButtonControlFrame
void GetTranslatedRect(nsIPresContext* aPresContext, nsRect& aRect); // XXX this implementation is a copy of nsHTMLButtonControlFrame
NS_IMETHOD_(nsrefcnt) AddRef(void);
NS_IMETHOD_(nsrefcnt) Release(void);
@ -198,7 +198,7 @@ nsImageControlFrame::Reflow(nsIPresContext& aPresContext,
// create our view, we need a view to grab the mouse
nsIView* view;
GetView(&view);
GetView(&aPresContext, &view);
if (!view) {
nsresult result = nsComponentManager::CreateInstance(kViewCID, nsnull, kIViewIID, (void **)&view);
nsCOMPtr<nsIPresShell> presShell;
@ -208,14 +208,14 @@ nsImageControlFrame::Reflow(nsIPresContext& aPresContext,
nsIFrame* parWithView;
nsIView *parView;
GetParentWithView(&parWithView);
parWithView->GetView(&parView);
GetParentWithView(&aPresContext, &parWithView);
parWithView->GetView(&aPresContext, &parView);
// the view's size is not know yet, but its size will be kept in synch with our frame.
nsRect boundBox(0, 0, 500, 500);
result = view->Init(viewMan, boundBox, parView, nsnull);
view->SetContentTransparency(PR_TRUE);
viewMan->InsertChild(parView, view, 0);
SetView(view);
SetView(&aPresContext, view);
const nsStyleColor* color = (const nsStyleColor*) mStyleContext->GetStyleData(eStyleStruct_Color);
// set the opacity
@ -291,11 +291,11 @@ nsImageControlFrame::ScrollIntoView(nsIPresContext* aPresContext)
}
void
nsImageControlFrame::GetTranslatedRect(nsRect& aRect)
nsImageControlFrame::GetTranslatedRect(nsIPresContext* aPresContext, nsRect& aRect)
{
nsIView* view;
nsPoint viewOffset(0,0);
GetOffsetFromView(viewOffset, &view);
GetOffsetFromView(aPresContext, viewOffset, &view);
while (nsnull != view) {
nsPoint tempOffset;
view->GetPosition(&tempOffset.x, &tempOffset.y);
@ -460,7 +460,8 @@ nsresult nsImageControlFrame::RequiresWidget(PRBool& aRequiresWidget)
}
NS_IMETHODIMP nsImageControlFrame::SetProperty(nsIAtom* aName, const nsString& aValue)
NS_IMETHODIMP nsImageControlFrame::SetProperty(nsIPresContext* aPresContext,
nsIAtom* aName, const nsString& aValue)
{
return NS_OK;
}

Просмотреть файл

@ -508,14 +508,14 @@ nsListControlFrame::GetSelectableFrame(nsIFrame *aFrame)
//---------------------------------------------------------
void
nsListControlFrame::ForceRedraw()
nsListControlFrame::ForceRedraw(nsIPresContext* aPresContext)
{
//XXX: Hack. This should not be needed. The problem is DisplaySelected
//and DisplayDeselected set and unset an attribute on generic HTML content
//which does not know that it should repaint as the result of the attribute
//being set. This should not be needed once the event state manager handles
//selection.
nsFormControlHelper::ForceDrawFrame(this);
nsFormControlHelper::ForceDrawFrame(aPresContext, this);
}
@ -803,12 +803,12 @@ nsListControlFrame::HasSameContent(nsIFrame* aFrame1, nsIFrame* aFrame2)
//---------------------------------------------------------
NS_IMETHODIMP
nsListControlFrame::CaptureMouseEvents(PRBool aGrabMouseEvents)
nsListControlFrame::CaptureMouseEvents(nsIPresContext* aPresContext, PRBool aGrabMouseEvents)
{
// get its view
nsIView* view = nsnull;
GetView(&view);
GetView(aPresContext, &view);
nsCOMPtr<nsIViewManager> viewMan;
PRBool result;
@ -974,7 +974,7 @@ nsListControlFrame::Init(nsIPresContext& aPresContext,
// get the proper style based on attribute selectors which refer to the
// selected attribute.
if (!mIsInitializedFromContent) {
Reset();
Reset(&aPresContext);
} else {
InitSelectionCache(-1);
}
@ -1320,7 +1320,7 @@ nsListControlFrame::GetMaxNumValues()
// those values as determined by the original HTML
//---------------------------------------------------------
void
nsListControlFrame::Reset()
nsListControlFrame::Reset(nsIPresContext* aPresContext)
{
nsIDOMHTMLCollection* options = GetOptions(mContent);
if (!options) {
@ -1604,7 +1604,7 @@ nsListControlFrame::ToggleSelected(PRInt32 aIndex)
// nsISelectControlFrame
//----------------------------------------------------------------------
NS_IMETHODIMP
nsListControlFrame::AddOption(PRInt32 aIndex)
nsListControlFrame::AddOption(nsIPresContext* aPresContext, PRInt32 aIndex)
{
PRInt32 numOptions;
GetNumberOfOptions(&numOptions);
@ -1623,7 +1623,7 @@ nsListControlFrame::AddOption(PRInt32 aIndex)
}
NS_IMETHODIMP
nsListControlFrame::RemoveOption(PRInt32 aIndex)
nsListControlFrame::RemoveOption(nsIPresContext* aPresContext, PRInt32 aIndex)
{
PRInt32 numOptions;
GetNumberOfOptions(&numOptions);
@ -1815,7 +1815,7 @@ nsListControlFrame::GetOptionSelected(PRInt32 aIndex, PRBool* aValue)
//---------------------------------------------------------
NS_IMETHODIMP
nsListControlFrame::SetProperty(nsIAtom* aName, const nsString& aValue)
nsListControlFrame::SetProperty(nsIPresContext* aPresContext, nsIAtom* aName, const nsString& aValue)
{
if (nsHTMLAtoms::selected == aName) {
return NS_ERROR_INVALID_ARG; // Selected is readonly according to spec.
@ -1919,7 +1919,7 @@ nsListControlFrame::GetViewOffset(nsIViewManager* aManager, nsIView* aView,
//---------------------------------------------------------
NS_IMETHODIMP
nsListControlFrame::SyncViewWithFrame()
nsListControlFrame::SyncViewWithFrame(nsIPresContext* aPresContext)
{
// Resync the view's position with the frame.
// The problem is the dropdown's view is attached directly under
@ -1932,21 +1932,21 @@ nsListControlFrame::SyncViewWithFrame()
//Get parent frame
nsIFrame* parent;
GetParentWithView(&parent);
GetParentWithView(aPresContext, &parent);
NS_ASSERTION(parent, "GetParentWithView failed");
// Get parent view
nsIView* parentView = nsnull;
parent->GetView(&parentView);
parent->GetView(aPresContext, &parentView);
parentView->GetViewManager(*getter_AddRefs(viewManager));
GetViewOffset(viewManager, parentView, parentPos);
nsIView* view = nsnull;
GetView(&view);
GetView(aPresContext, &view);
nsIView* containingView = nsnull;
nsPoint offset;
GetOffsetFromView(offset, &containingView);
GetOffsetFromView(aPresContext, offset, &containingView);
//nsSize size;
//GetSize(size);
@ -2001,12 +2001,14 @@ nsListControlFrame::AboutToRollup()
//---------------------------------------------------------
nsresult
nsListControlFrame::GetScrollingParentView(nsIFrame* aParent, nsIView** aParentView)
nsListControlFrame::GetScrollingParentView(nsIPresContext* aPresContext,
nsIFrame* aParent,
nsIView** aParentView)
{
if (IsInDropDownMode() == PR_TRUE) {
// Use the parent frame to get the view manager
nsIView* parentView = nsnull;
nsresult rv = aParent->GetView(&parentView);
nsresult rv = aParent->GetView(aPresContext, &parentView);
NS_ASSERTION(parentView, "GetView failed");
nsCOMPtr<nsIViewManager> viewManager;
parentView->GetViewManager(*getter_AddRefs(viewManager));
@ -2022,7 +2024,7 @@ nsListControlFrame::GetScrollingParentView(nsIFrame* aParent, nsIView** aParentV
NS_ASSERTION(aParentView, "GetRootView failed");
return rv;
} else {
return nsScrollFrame::GetScrollingParentView(aParent, aParentView);
return nsScrollFrame::GetScrollingParentView(aPresContext, aParent, aParentView);
}
}
@ -2037,25 +2039,25 @@ nsListControlFrame::DidReflow(nsIPresContext& aPresContext,
mState &= ~NS_FRAME_SYNC_FRAME_AND_VIEW;
nsresult rv = nsScrollFrame::DidReflow(aPresContext, aStatus);
mState |= NS_FRAME_SYNC_FRAME_AND_VIEW;
SyncViewWithFrame();
SyncViewWithFrame(&aPresContext);
return rv;
} else {
return nsScrollFrame::DidReflow(aPresContext, aStatus);
}
}
NS_IMETHODIMP nsListControlFrame::MoveTo(nscoord aX, nscoord aY)
NS_IMETHODIMP nsListControlFrame::MoveTo(nsIPresContext* aPresContext, nscoord aX, nscoord aY)
{
if (PR_TRUE == IsInDropDownMode())
{
//SyncViewWithFrame();
mState &= ~NS_FRAME_SYNC_FRAME_AND_VIEW;
nsresult rv = nsScrollFrame::MoveTo(aX, aY);
nsresult rv = nsScrollFrame::MoveTo(aPresContext, aX, aY);
mState |= NS_FRAME_SYNC_FRAME_AND_VIEW;
//SyncViewWithFrame();
return rv;
} else {
return nsScrollFrame::MoveTo(aX, aY);
return nsScrollFrame::MoveTo(aPresContext, aX, aY);
}
}
@ -2150,7 +2152,7 @@ nsListControlFrame::MouseUp(nsIDOMEvent* aMouseEvent)
}
} else {
mButtonDown = PR_FALSE;
CaptureMouseEvents(PR_FALSE);
CaptureMouseEvents(mPresContext, PR_FALSE);
UpdateSelection(PR_TRUE, PR_FALSE, mContent);
}
@ -2227,10 +2229,10 @@ nsListControlFrame::MouseDown(nsIDOMEvent* aMouseEvent)
// the pop up stole focus away from the webshell
// now I am giving it back
nsIFrame * parentFrame;
GetParentWithView(&parentFrame);
GetParentWithView(mPresContext, &parentFrame);
if (nsnull != parentFrame) {
nsIView * pView;
parentFrame->GetView(&pView);
parentFrame->GetView(mPresContext, &pView);
if (nsnull != pView) {
nsIWidget *window = nsnull;
@ -2257,7 +2259,7 @@ nsListControlFrame::MouseDown(nsIDOMEvent* aMouseEvent)
mOldSelectedIndex = oldIndex;
// Handle Like List
mButtonDown = PR_TRUE;
CaptureMouseEvents(PR_TRUE);
CaptureMouseEvents(mPresContext, PR_TRUE);
HandleListSelection(aMouseEvent);
}
} else {
@ -2291,7 +2293,7 @@ nsListControlFrame::MouseDown(nsIDOMEvent* aMouseEvent)
//stateManager->SetContentState(mContent, NS_EVENT_STATE_FOCUS);
if (isDroppedDown) {
CaptureMouseEvents(PR_FALSE);
CaptureMouseEvents(mPresContext, PR_FALSE);
}
NS_RELEASE(stateManager);
@ -2438,14 +2440,16 @@ nsListControlFrame::KeyDown(nsIDOMEvent* aKeyEvent)
// nsIStatefulFrame
//----------------------------------------------------------------------
NS_IMETHODIMP
nsListControlFrame::GetStateType(nsIStatefulFrame::StateType* aStateType)
nsListControlFrame::GetStateType(nsIPresContext* aPresContext,
nsIStatefulFrame::StateType* aStateType)
{
*aStateType = nsIStatefulFrame::eSelectType;
return NS_OK;
}
NS_IMETHODIMP
nsListControlFrame::SaveState(nsISupports** aState)
nsListControlFrame::SaveState(nsIPresContext* aPresContext,
nsISupports** aState)
{
nsISupportsArray* value = nsnull;
nsresult res = NS_NewISupportsArray(&value);
@ -2480,7 +2484,8 @@ nsListControlFrame::SaveState(nsISupports** aState)
}
NS_IMETHODIMP
nsListControlFrame::RestoreState(nsISupports* aState)
nsListControlFrame::RestoreState(nsIPresContext* aPresContext,
nsISupports* aState)
{
nsISupportsArray* value = (nsISupportsArray *)aState;
nsresult res = NS_ERROR_NULL_POINTER;

Просмотреть файл

@ -75,12 +75,12 @@ public:
nsIFrame* aPrevInFlow);
NS_IMETHOD DidReflow(nsIPresContext& aPresContext, nsDidReflowStatus aStatus);
NS_IMETHOD MoveTo(nscoord aX, nscoord aY);
NS_IMETHOD MoveTo(nsIPresContext* aPresContext, nscoord aX, nscoord aY);
// nsIFormControlFrame
NS_IMETHOD GetType(PRInt32* aType) const;
NS_IMETHOD GetName(nsString* aName);
NS_IMETHOD SetProperty(nsIAtom* aName, const nsString& aValue);
NS_IMETHOD SetProperty(nsIPresContext* aPresContext, nsIAtom* aName, const nsString& aValue);
NS_IMETHOD GetProperty(nsIAtom* aName, nsString& aValue);
NS_IMETHOD GetMultiple(PRBool* aResult, nsIDOMHTMLSelectElement* aSelect = nsnull);
NS_IMETHOD GetFont(nsIPresContext* aPresContext,
@ -90,7 +90,7 @@ public:
virtual void SetFocus(PRBool aOn = PR_TRUE, PRBool aRepaint = PR_FALSE);
virtual void ScrollIntoView(nsIPresContext* aPresContext);
virtual void MouseClicked(nsIPresContext* aPresContext);
virtual void Reset();
virtual void Reset(nsIPresContext* aPresContext);
virtual PRBool IsSuccessful(nsIFormControlFrame* aSubmitter);
virtual PRInt32 GetMaxNumValues();
virtual PRBool GetNamesValues(PRInt32 aMaxNumValues, PRInt32& aNumValues,
@ -112,25 +112,25 @@ public:
NS_IMETHOD SetComboboxFrame(nsIFrame* aComboboxFrame);
NS_IMETHOD GetSelectedIndex(PRInt32* aIndex);
NS_IMETHOD GetSelectedItem(nsString & aStr);
NS_IMETHOD CaptureMouseEvents(PRBool aGrabMouseEvents);
NS_IMETHOD CaptureMouseEvents(nsIPresContext* aPresContext, PRBool aGrabMouseEvents);
NS_IMETHOD GetMaximumSize(nsSize &aSize);
NS_IMETHOD SetSuggestedSize(nscoord aWidth, nscoord aHeight);
NS_IMETHOD GetNumberOfOptions(PRInt32* aNumOptions);
NS_IMETHOD SyncViewWithFrame();
NS_IMETHOD SyncViewWithFrame(nsIPresContext* aPresContext);
NS_IMETHOD AboutToDropDown();
NS_IMETHOD AboutToRollup();
NS_IMETHOD UpdateSelection(PRBool aDoDispatchEvent, PRBool aForceUpdate, nsIContent* aContent);
// nsISelectControlFrame
NS_IMETHOD AddOption(PRInt32 index);
NS_IMETHOD RemoveOption(PRInt32 index);
NS_IMETHOD AddOption(nsIPresContext* aPresContext, PRInt32 index);
NS_IMETHOD RemoveOption(nsIPresContext* aPresContext, PRInt32 index);
NS_IMETHOD SetOptionSelected(PRInt32 aIndex, PRBool aValue);
NS_IMETHOD GetOptionSelected(PRInt32 aIndex, PRBool* aValue);
//nsIStatefulFrame
NS_IMETHOD GetStateType(StateType* aStateType);
NS_IMETHOD SaveState(nsISupports** aState);
NS_IMETHOD RestoreState(nsISupports* aState);
NS_IMETHOD GetStateType(nsIPresContext* aPresContext, StateType* aStateType);
NS_IMETHOD SaveState(nsIPresContext* aPresContext, nsISupports** aState);
NS_IMETHOD RestoreState(nsIPresContext* aPresContext, nsISupports* aState);
//nsIDOMEventListener
virtual nsresult MouseDown(nsIDOMEvent* aMouseEvent);
@ -168,7 +168,9 @@ protected:
// Override the widget created for the list box so a Borderless top level widget is created
// for drop-down lists.
virtual nsresult CreateScrollingViewWidget(nsIView* aView,const nsStylePosition* aPosition);
virtual nsresult GetScrollingParentView(nsIFrame* aParent, nsIView** aParentView);
virtual nsresult GetScrollingParentView(nsIPresContext* aPresContext,
nsIFrame* aParent,
nsIView** aParentView);
PRInt32 GetNumberOfOptions();
// Utility methods
@ -192,7 +194,7 @@ protected:
nsIFrame *GetSelectableFrame(nsIFrame *aFrame);
void DisplaySelected(nsIContent* aContent);
void DisplayDeselected(nsIContent* aContent);
void ForceRedraw();
void ForceRedraw(nsIPresContext* aPresContext);
PRBool IsOptionGroup(nsIFrame* aFrame);
void SingleSelection();
void MultipleSelection(PRBool aIsShift, PRBool aIsControl);

Просмотреть файл

@ -86,9 +86,11 @@ nsSelectsAreaFrame::IsOptionElementFrame(nsIFrame *aFrame)
//---------------------------------------------------------
NS_IMETHODIMP
nsSelectsAreaFrame::GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame)
nsSelectsAreaFrame::GetFrameForPoint(nsIPresContext* aPresContext,
const nsPoint& aPoint,
nsIFrame** aFrame)
{
nsAreaFrame::GetFrameForPoint(aPoint, aFrame);
nsAreaFrame::GetFrameForPoint(aPresContext, aPoint, aFrame);
nsIFrame* selectedFrame = *aFrame;

Просмотреть файл

@ -35,7 +35,7 @@ public:
// nsISupports
//NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
NS_IMETHOD GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame);
NS_IMETHOD GetFrameForPoint(nsIPresContext* aPresContext, const nsPoint& aPoint, nsIFrame** aFrame);
protected:
PRBool IsOptionElement(nsIContent* aContent);

Просмотреть файл

@ -349,14 +349,14 @@ nsTextControlFrame::SetSuggestedSize(nscoord aWidth, nscoord aHeight)
// nsIStatefulFrame
//----------------------------------------------------------------------
NS_IMETHODIMP
nsTextControlFrame::GetStateType(nsIStatefulFrame::StateType* aStateType)
nsTextControlFrame::GetStateType(nsIPresContext* aPresContext, nsIStatefulFrame::StateType* aStateType)
{
*aStateType = nsIStatefulFrame::eTextType;
return NS_OK;
}
NS_IMETHODIMP
nsTextControlFrame::SaveState(nsISupports** aState)
nsTextControlFrame::SaveState(nsIPresContext* aPresContext, nsISupports** aState)
{
nsISupportsString* value = nsnull;
nsAutoString string;
@ -379,13 +379,13 @@ nsTextControlFrame::SaveState(nsISupports** aState)
}
NS_IMETHODIMP
nsTextControlFrame::RestoreState(nsISupports* aState)
nsTextControlFrame::RestoreState(nsIPresContext* aPresContext, nsISupports* aState)
{
char* chars = nsnull;
nsresult res = ((nsISupportsString*)aState)->GetData(&chars);
if (NS_SUCCEEDED(res) && chars) {
nsAutoString string(chars);
res = SetProperty(nsHTMLAtoms::value, string);
res = SetProperty(aPresContext, nsHTMLAtoms::value, string);
nsCRT::free(chars);
}
return res;

Просмотреть файл

@ -56,9 +56,9 @@ public:
NS_IMETHOD SetSuggestedSize(nscoord aWidth, nscoord aHeight);
//nsIStatefulFrame
NS_IMETHOD GetStateType(StateType* aStateType);
NS_IMETHOD SaveState(nsISupports** aState);
NS_IMETHOD RestoreState(nsISupports* aState);
NS_IMETHOD GetStateType(nsIPresContext* aPresContext, StateType* aStateType);
NS_IMETHOD SaveState(nsIPresContext* aPresContext, nsISupports** aState);
NS_IMETHOD RestoreState(nsIPresContext* aPresContext, nsISupports* aState);
protected:
@ -81,7 +81,7 @@ private:
/* ---------- abstract methods derived class must implement ---------- */
public:
// nsIFormControlFrame
NS_IMETHOD SetProperty(nsIAtom* aName, const nsString& aValue)=0;
NS_IMETHOD SetProperty(nsIPresContext* aPresContext, nsIAtom* aName, const nsString& aValue)=0;
NS_IMETHOD GetProperty(nsIAtom* aName, nsString& aValue)=0;
virtual nsWidgetInitData* GetWidgetInitData(nsIPresContext& aPresContext)=0;

Просмотреть файл

@ -365,7 +365,7 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegat
nsRect rect(border.left + kidReflowState.mComputedOffsets.left + kidReflowState.mComputedMargin.left,
border.top + kidReflowState.mComputedOffsets.top + kidReflowState.mComputedMargin.top,
kidDesiredSize.width, kidDesiredSize.height);
aKidFrame->SetRect(rect);
aKidFrame->SetRect(&aPresContext, rect);
}
return rv;

Просмотреть файл

@ -339,7 +339,7 @@ nsAreaFrame::DidReflow(nsIPresContext& aPresContext,
const nsStyleDisplay* display = (const nsStyleDisplay*)
mStyleContext->GetStyleData(eStyleStruct_Display);
GetView(&view);
GetView(&aPresContext, &view);
if (view && (NS_STYLE_OVERFLOW_VISIBLE == display->mOverflow)) {
// Don't let our base class position the view since we're doing it
mState &= ~NS_FRAME_SYNC_FRAME_AND_VIEW;
@ -357,7 +357,7 @@ nsAreaFrame::DidReflow(nsIPresContext& aPresContext,
// XXX We need to handle the case where child frames stick out on the
// left and top edges as well...
GetOffsetFromView(origin, &parentWithView);
GetOffsetFromView(&aPresContext, origin, &parentWithView);
vm->ResizeView(view, mCombinedArea.XMost(), mCombinedArea.YMost());
vm->MoveViewTo(view, origin.x, origin.y);
NS_RELEASE(vm);

Просмотреть файл

@ -1016,7 +1016,7 @@ nsBlockReflowState::RecoverStateFrom(nsLineBox* aLine,
fc->mCombinedArea.y += finalDeltaY;
nsIFrame* floater = fc->mPlaceholder->GetOutOfFlowFrame();
floater->GetRect(r);
floater->MoveTo(r.x, r.y + finalDeltaY);
floater->MoveTo(mPresContext, r.x, r.y + finalDeltaY);
#ifdef DEBUG
if (gNoisyReflow || gNoisySpaceManager) {
nscoord tx, ty;
@ -1161,12 +1161,12 @@ ListTextRuns(FILE* out, PRInt32 aIndent, nsTextRun* aRuns)
}
NS_METHOD
nsBlockFrame::List(FILE* out, PRInt32 aIndent) const
nsBlockFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const
{
IndentBy(out, aIndent);
ListTag(out);
nsIView* view;
GetView(&view);
GetView(aPresContext, &view);
if (nsnull != view) {
fprintf(out, " [view=%p]", view);
}
@ -1211,7 +1211,7 @@ nsBlockFrame::List(FILE* out, PRInt32 aIndent) const
if (nsnull != mLines) {
nsLineBox* line = mLines;
while (nsnull != line) {
line->List(out, aIndent);
line->List(aPresContext, out, aIndent);
line = line->mNext;
}
}
@ -1234,7 +1234,7 @@ nsBlockFrame::List(FILE* out, PRInt32 aIndent) const
}
fputs("<\n", out);
while (nsnull != kid) {
kid->List(out, aIndent + 1);
kid->List(aPresContext, out, aIndent + 1);
kid->GetNextSibling(&kid);
}
IndentBy(out, aIndent);
@ -1416,7 +1416,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext,
ListTag(stdout);
printf(": reflow=initial\n");
#endif
DrainOverflowLines();
DrainOverflowLines(&aPresContext);
rv = PrepareInitialReflow(state);
mState &= ~NS_FRAME_FIRST_REFLOW;
break;
@ -1467,7 +1467,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext,
ListTag(stdout);
printf(": reflow=resize (%d)\n", aReflowState.reason);
#endif
DrainOverflowLines();
DrainOverflowLines(&aPresContext);
rv = PrepareResizeReflow(state);
break;
}
@ -1534,7 +1534,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext,
if (isStyleChange) {
// Lots of things could have changed so damage our entire
// bounds
Invalidate(nsRect(0, 0, mRect.width, mRect.height));
Invalidate(&aPresContext, nsRect(0, 0, mRect.width, mRect.height));
} else {
nsMargin border = aReflowState.mComputedBorderPadding -
@ -1560,7 +1560,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext,
damageRect.y = 0;
damageRect.height = mRect.height;
}
Invalidate(damageRect);
Invalidate(&aPresContext, damageRect);
}
// See if our height changed
@ -1583,7 +1583,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext,
damageRect.y = mRect.height - border.bottom;
damageRect.height = border.bottom;
}
Invalidate(damageRect);
Invalidate(&aPresContext, damageRect);
}
}
}
@ -2429,7 +2429,7 @@ nsBlockFrame::ReflowDirtyLines(nsBlockReflowState& aState)
RecoverStateFrom(aState, line, deltaY, incrementalReflow ?
&damageRect : 0);
if (incrementalReflow && !damageRect.IsEmpty()) {
Invalidate(damageRect);
Invalidate(aState.mPresContext, damageRect);
}
}
@ -2482,7 +2482,7 @@ nsBlockFrame::ReflowDirtyLines(nsBlockReflowState& aState)
frame->SetParent(this);
// When pushing and pulling frames we need to check for whether any
// views need to be reparented
nsHTMLContainerFrame::ReparentFrameView(frame, mNextInFlow, this);
nsHTMLContainerFrame::ReparentFrameView(aState.mPresContext, frame, mNextInFlow, this);
lastFrame = frame;
frame->GetNextSibling(&frame);
}
@ -2602,7 +2602,7 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState,
// XXX We need to improve on this...
nsRect dirtyRect;
dirtyRect.UnionRect(oldCombinedArea, lineCombinedArea);
Invalidate(dirtyRect);
Invalidate(aState.mPresContext, dirtyRect);
} else {
if (oldCombinedArea.width != lineCombinedArea.width) {
@ -2618,7 +2618,7 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState,
dirtyRect.x;
dirtyRect.height = PR_MAX(oldCombinedArea.height,
lineCombinedArea.height);
Invalidate(dirtyRect);
Invalidate(aState.mPresContext, dirtyRect);
}
if (oldCombinedArea.height != lineCombinedArea.height) {
nsRect dirtyRect;
@ -2633,7 +2633,7 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState,
dirtyRect.height = PR_MAX(oldCombinedArea.YMost(),
lineCombinedArea.YMost()) -
dirtyRect.y;
Invalidate(dirtyRect);
Invalidate(aState.mPresContext, dirtyRect);
}
}
}
@ -2649,7 +2649,7 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState,
nsRect dirtyRect;
dirtyRect.UnionRect(oldCombinedArea, combinedArea);
Invalidate(dirtyRect);
Invalidate(aState.mPresContext, dirtyRect);
}
}
@ -2758,7 +2758,7 @@ nsBlockFrame::PullFrame(nsBlockReflowState& aState,
// When pushing and pulling frames we need to check for whether any
// views need to be reparented
NS_ASSERTION(oldParentFrame != this, "unexpected parent frame");
nsHTMLContainerFrame::ReparentFrameView(frame, oldParentFrame, this);
nsHTMLContainerFrame::ReparentFrameView(aState.mPresContext, frame, oldParentFrame, this);
// The frame is being pulled from a next-in-flow; therefore we
// need to add it to our sibling list.
@ -2796,7 +2796,7 @@ nsBlockFrame::SlideLine(nsBlockReflowState& aState,
kid->GetRect(r);
if (aDY) {
r.y += aDY;
kid->SetRect(r);
kid->SetRect(aState.mPresContext, r);
}
// If the child has any floaters that impact the space-manager,
@ -2827,7 +2827,7 @@ nsBlockFrame::SlideLine(nsBlockReflowState& aState,
while (--n >= 0) {
kid->GetRect(r);
r.y += aDY;
kid->SetRect(r);
kid->SetRect(aState.mPresContext, r);
kid->GetNextSibling(&kid);
}
}
@ -3361,7 +3361,7 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState,
nscoord bulletTopMargin = applyTopMargin ? collapsedBottomMargin : 0;
bbox.y = aState.BorderPadding().top + ascent -
metrics.ascent + bulletTopMargin;
mBullet->SetRect(bbox);
mBullet->SetRect(aState.mPresContext, bbox);
}
}
else {
@ -4160,7 +4160,7 @@ nsBlockFrame::PushLines(nsBlockReflowState& aState)
}
PRBool
nsBlockFrame::DrainOverflowLines()
nsBlockFrame::DrainOverflowLines(nsIPresContext* aPresContext)
{
#ifdef DEBUG
VerifyOverflowSituation();
@ -4183,7 +4183,7 @@ nsBlockFrame::DrainOverflowLines()
// When pushing and pulling frames we need to check for whether any
// views need to be reparented
nsHTMLContainerFrame::ReparentFrameView(frame, prevBlock, this);
nsHTMLContainerFrame::ReparentFrameView(aPresContext, frame, prevBlock, this);
// Get the next frame
lastFrame = frame;
@ -4721,7 +4721,7 @@ nsBlockFrame::FixParentAndView(nsIPresContext* aPresContext, nsIFrame* aFrame)
aFrame->GetParent(&oldParent);
aFrame->SetParent(this);
if (this != oldParent) {
nsHTMLContainerFrame::ReparentFrameView(aFrame, oldParent, this);
nsHTMLContainerFrame::ReparentFrameView(aPresContext, aFrame, oldParent, this);
aPresContext->ReParentStyleContext(aFrame, mStyleContext);
}
aFrame->GetNextSibling(&aFrame);
@ -4902,7 +4902,7 @@ nsBlockFrame::DoRemoveFrame(nsIPresContext* aPresContext,
// cases...
nsRect lineCombinedArea;
line->GetCombinedArea(&lineCombinedArea);
Invalidate(lineCombinedArea);
Invalidate(aPresContext, lineCombinedArea);
delete line;
line = next;
}
@ -5063,7 +5063,7 @@ nsBlockFrame::ReflowFloater(nsBlockReflowState& aState,
const nsHTMLReflowMetrics& metrics = brc.GetMetrics();
aCombinedRect = metrics.mCombinedArea;
floater->SizeTo(metrics.width, metrics.height);
floater->SizeTo(aState.mPresContext, metrics.width, metrics.height);
// Stash away the max-element-size for later
aState.StoreMaxElementSize(floater, brc.GetMaxElementSize());
@ -5402,7 +5402,7 @@ nsBlockReflowState::PlaceFloater(nsFloaterCache* aFloaterCache,
x += aFloaterCache->mOffsets.left;
y += aFloaterCache->mOffsets.top;
}
floater->MoveTo(x, y);
floater->MoveTo(mPresContext, x, y);
// Update the floater combined area state
nsRect combinedArea = aFloaterCache->mCombinedArea;
@ -5818,7 +5818,7 @@ nsBlockFrame::HandleEvent(nsIPresContext& aPresContext,
while(NS_SUCCEEDED(result))
{ //we are starting aloop to allow us to "drill down to the one we want"
mainframe->GetOffsetFromView(origin, &parentWithView);
mainframe->GetOffsetFromView(&aPresContext, origin, &parentWithView);
if (NS_FAILED(result))
return NS_OK;//do not handle
@ -5865,7 +5865,8 @@ nsBlockFrame::HandleEvent(nsIPresContext& aPresContext,
pos.mDirection = eDirNext;
pos.mDesiredX = aEvent->point.x;
result = nsFrame::GetNextPrevLineFromeBlockFrame(&pos,
result = nsFrame::GetNextPrevLineFromeBlockFrame(&aPresContext,
&pos,
mainframe,
closestLine-1,
0
@ -5893,20 +5894,22 @@ nsBlockFrame::HandleEvent(nsIPresContext& aPresContext,
NS_IMETHODIMP
nsBlockFrame::GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame)
nsBlockFrame::GetFrameForPoint(nsIPresContext* aPresContext,
const nsPoint& aPoint,
nsIFrame** aFrame)
{
nsresult rv = GetFrameForPointUsing(aPoint, nsnull, aFrame);
nsresult rv = GetFrameForPointUsing(aPresContext, aPoint, nsnull, aFrame);
if (NS_OK == rv) {
return NS_OK;
}
if (nsnull != mBullet) {
rv = GetFrameForPointUsing(aPoint, nsLayoutAtoms::bulletList, aFrame);
rv = GetFrameForPointUsing(aPresContext, aPoint, nsLayoutAtoms::bulletList, aFrame);
if (NS_OK == rv) {
return NS_OK;
}
}
if (mFloaters.NotEmpty()) {
rv = GetFrameForPointUsing(aPoint, nsLayoutAtoms::floaterList, aFrame);
rv = GetFrameForPointUsing(aPresContext, aPoint, nsLayoutAtoms::floaterList, aFrame);
if (NS_OK == rv) {
return NS_OK;
}
@ -6339,7 +6342,7 @@ nsBlockFrame::ReflowBullet(nsBlockReflowState& aState,
// the final vertical location.
const nsMargin& bp = aState.BorderPadding();
nscoord y = bp.top;
mBullet->SetRect(nsRect(x, y, aMetrics.width, aMetrics.height));
mBullet->SetRect(aState.mPresContext, nsRect(x, y, aMetrics.width, aMetrics.height));
}
//XXX get rid of this -- its slow

Просмотреть файл

@ -93,14 +93,14 @@ public:
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer);
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const;
NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
#endif
NS_IMETHOD VerifyTree() const;
NS_IMETHOD GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame);
NS_IMETHOD GetFrameForPoint(nsIPresContext* aPresContext, const nsPoint& aPoint, nsIFrame** aFrame);
NS_IMETHOD HandleEvent(nsIPresContext& aPresContext,
nsGUIEvent* aEvent,
nsEventStatus& aEventStatus);
@ -161,7 +161,7 @@ protected:
void SlideLine(nsBlockReflowState& aState,
nsLineBox* aLine, nscoord aDY);
PRBool DrainOverflowLines();
PRBool DrainOverflowLines(nsIPresContext* aPresContext);
virtual PRIntn GetSkipSides() const;

Просмотреть файл

@ -419,7 +419,7 @@ nsBlockReflowContext::PlaceBlock(PRBool aForceFit,
// Empty blocks do not have anything special done to them and they
// always fit. Note: don't force the width to 0
nsRect r(x, y, mMetrics.width, 0);
mFrame->SetRect(r);
mFrame->SetRect(mPresContext, r);
aInFlowBounds = r;
// Retain combined area information in case we contain a floater
@ -547,7 +547,7 @@ nsBlockReflowContext::PlaceBlock(PRBool aForceFit,
aCombinedRect.height = mMetrics.mCombinedArea.height;
// Now place the frame
mFrame->SetRect(nsRect(x, y, mMetrics.width, mMetrics.height));
mFrame->SetRect(mPresContext, nsRect(x, y, mMetrics.width, mMetrics.height));
// XXX obsolete, i believe...
#if 0

Просмотреть файл

@ -1016,7 +1016,7 @@ nsBlockReflowState::RecoverStateFrom(nsLineBox* aLine,
fc->mCombinedArea.y += finalDeltaY;
nsIFrame* floater = fc->mPlaceholder->GetOutOfFlowFrame();
floater->GetRect(r);
floater->MoveTo(r.x, r.y + finalDeltaY);
floater->MoveTo(mPresContext, r.x, r.y + finalDeltaY);
#ifdef DEBUG
if (gNoisyReflow || gNoisySpaceManager) {
nscoord tx, ty;
@ -1161,12 +1161,12 @@ ListTextRuns(FILE* out, PRInt32 aIndent, nsTextRun* aRuns)
}
NS_METHOD
nsBlockFrame::List(FILE* out, PRInt32 aIndent) const
nsBlockFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const
{
IndentBy(out, aIndent);
ListTag(out);
nsIView* view;
GetView(&view);
GetView(aPresContext, &view);
if (nsnull != view) {
fprintf(out, " [view=%p]", view);
}
@ -1211,7 +1211,7 @@ nsBlockFrame::List(FILE* out, PRInt32 aIndent) const
if (nsnull != mLines) {
nsLineBox* line = mLines;
while (nsnull != line) {
line->List(out, aIndent);
line->List(aPresContext, out, aIndent);
line = line->mNext;
}
}
@ -1234,7 +1234,7 @@ nsBlockFrame::List(FILE* out, PRInt32 aIndent) const
}
fputs("<\n", out);
while (nsnull != kid) {
kid->List(out, aIndent + 1);
kid->List(aPresContext, out, aIndent + 1);
kid->GetNextSibling(&kid);
}
IndentBy(out, aIndent);
@ -1416,7 +1416,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext,
ListTag(stdout);
printf(": reflow=initial\n");
#endif
DrainOverflowLines();
DrainOverflowLines(&aPresContext);
rv = PrepareInitialReflow(state);
mState &= ~NS_FRAME_FIRST_REFLOW;
break;
@ -1467,7 +1467,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext,
ListTag(stdout);
printf(": reflow=resize (%d)\n", aReflowState.reason);
#endif
DrainOverflowLines();
DrainOverflowLines(&aPresContext);
rv = PrepareResizeReflow(state);
break;
}
@ -1534,7 +1534,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext,
if (isStyleChange) {
// Lots of things could have changed so damage our entire
// bounds
Invalidate(nsRect(0, 0, mRect.width, mRect.height));
Invalidate(&aPresContext, nsRect(0, 0, mRect.width, mRect.height));
} else {
nsMargin border = aReflowState.mComputedBorderPadding -
@ -1560,7 +1560,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext,
damageRect.y = 0;
damageRect.height = mRect.height;
}
Invalidate(damageRect);
Invalidate(&aPresContext, damageRect);
}
// See if our height changed
@ -1583,7 +1583,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext,
damageRect.y = mRect.height - border.bottom;
damageRect.height = border.bottom;
}
Invalidate(damageRect);
Invalidate(&aPresContext, damageRect);
}
}
}
@ -2429,7 +2429,7 @@ nsBlockFrame::ReflowDirtyLines(nsBlockReflowState& aState)
RecoverStateFrom(aState, line, deltaY, incrementalReflow ?
&damageRect : 0);
if (incrementalReflow && !damageRect.IsEmpty()) {
Invalidate(damageRect);
Invalidate(aState.mPresContext, damageRect);
}
}
@ -2482,7 +2482,7 @@ nsBlockFrame::ReflowDirtyLines(nsBlockReflowState& aState)
frame->SetParent(this);
// When pushing and pulling frames we need to check for whether any
// views need to be reparented
nsHTMLContainerFrame::ReparentFrameView(frame, mNextInFlow, this);
nsHTMLContainerFrame::ReparentFrameView(aState.mPresContext, frame, mNextInFlow, this);
lastFrame = frame;
frame->GetNextSibling(&frame);
}
@ -2602,7 +2602,7 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState,
// XXX We need to improve on this...
nsRect dirtyRect;
dirtyRect.UnionRect(oldCombinedArea, lineCombinedArea);
Invalidate(dirtyRect);
Invalidate(aState.mPresContext, dirtyRect);
} else {
if (oldCombinedArea.width != lineCombinedArea.width) {
@ -2618,7 +2618,7 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState,
dirtyRect.x;
dirtyRect.height = PR_MAX(oldCombinedArea.height,
lineCombinedArea.height);
Invalidate(dirtyRect);
Invalidate(aState.mPresContext, dirtyRect);
}
if (oldCombinedArea.height != lineCombinedArea.height) {
nsRect dirtyRect;
@ -2633,7 +2633,7 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState,
dirtyRect.height = PR_MAX(oldCombinedArea.YMost(),
lineCombinedArea.YMost()) -
dirtyRect.y;
Invalidate(dirtyRect);
Invalidate(aState.mPresContext, dirtyRect);
}
}
}
@ -2649,7 +2649,7 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState,
nsRect dirtyRect;
dirtyRect.UnionRect(oldCombinedArea, combinedArea);
Invalidate(dirtyRect);
Invalidate(aState.mPresContext, dirtyRect);
}
}
@ -2758,7 +2758,7 @@ nsBlockFrame::PullFrame(nsBlockReflowState& aState,
// When pushing and pulling frames we need to check for whether any
// views need to be reparented
NS_ASSERTION(oldParentFrame != this, "unexpected parent frame");
nsHTMLContainerFrame::ReparentFrameView(frame, oldParentFrame, this);
nsHTMLContainerFrame::ReparentFrameView(aState.mPresContext, frame, oldParentFrame, this);
// The frame is being pulled from a next-in-flow; therefore we
// need to add it to our sibling list.
@ -2796,7 +2796,7 @@ nsBlockFrame::SlideLine(nsBlockReflowState& aState,
kid->GetRect(r);
if (aDY) {
r.y += aDY;
kid->SetRect(r);
kid->SetRect(aState.mPresContext, r);
}
// If the child has any floaters that impact the space-manager,
@ -2827,7 +2827,7 @@ nsBlockFrame::SlideLine(nsBlockReflowState& aState,
while (--n >= 0) {
kid->GetRect(r);
r.y += aDY;
kid->SetRect(r);
kid->SetRect(aState.mPresContext, r);
kid->GetNextSibling(&kid);
}
}
@ -3361,7 +3361,7 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState,
nscoord bulletTopMargin = applyTopMargin ? collapsedBottomMargin : 0;
bbox.y = aState.BorderPadding().top + ascent -
metrics.ascent + bulletTopMargin;
mBullet->SetRect(bbox);
mBullet->SetRect(aState.mPresContext, bbox);
}
}
else {
@ -4160,7 +4160,7 @@ nsBlockFrame::PushLines(nsBlockReflowState& aState)
}
PRBool
nsBlockFrame::DrainOverflowLines()
nsBlockFrame::DrainOverflowLines(nsIPresContext* aPresContext)
{
#ifdef DEBUG
VerifyOverflowSituation();
@ -4183,7 +4183,7 @@ nsBlockFrame::DrainOverflowLines()
// When pushing and pulling frames we need to check for whether any
// views need to be reparented
nsHTMLContainerFrame::ReparentFrameView(frame, prevBlock, this);
nsHTMLContainerFrame::ReparentFrameView(aPresContext, frame, prevBlock, this);
// Get the next frame
lastFrame = frame;
@ -4721,7 +4721,7 @@ nsBlockFrame::FixParentAndView(nsIPresContext* aPresContext, nsIFrame* aFrame)
aFrame->GetParent(&oldParent);
aFrame->SetParent(this);
if (this != oldParent) {
nsHTMLContainerFrame::ReparentFrameView(aFrame, oldParent, this);
nsHTMLContainerFrame::ReparentFrameView(aPresContext, aFrame, oldParent, this);
aPresContext->ReParentStyleContext(aFrame, mStyleContext);
}
aFrame->GetNextSibling(&aFrame);
@ -4902,7 +4902,7 @@ nsBlockFrame::DoRemoveFrame(nsIPresContext* aPresContext,
// cases...
nsRect lineCombinedArea;
line->GetCombinedArea(&lineCombinedArea);
Invalidate(lineCombinedArea);
Invalidate(aPresContext, lineCombinedArea);
delete line;
line = next;
}
@ -5063,7 +5063,7 @@ nsBlockFrame::ReflowFloater(nsBlockReflowState& aState,
const nsHTMLReflowMetrics& metrics = brc.GetMetrics();
aCombinedRect = metrics.mCombinedArea;
floater->SizeTo(metrics.width, metrics.height);
floater->SizeTo(aState.mPresContext, metrics.width, metrics.height);
// Stash away the max-element-size for later
aState.StoreMaxElementSize(floater, brc.GetMaxElementSize());
@ -5402,7 +5402,7 @@ nsBlockReflowState::PlaceFloater(nsFloaterCache* aFloaterCache,
x += aFloaterCache->mOffsets.left;
y += aFloaterCache->mOffsets.top;
}
floater->MoveTo(x, y);
floater->MoveTo(mPresContext, x, y);
// Update the floater combined area state
nsRect combinedArea = aFloaterCache->mCombinedArea;
@ -5818,7 +5818,7 @@ nsBlockFrame::HandleEvent(nsIPresContext& aPresContext,
while(NS_SUCCEEDED(result))
{ //we are starting aloop to allow us to "drill down to the one we want"
mainframe->GetOffsetFromView(origin, &parentWithView);
mainframe->GetOffsetFromView(&aPresContext, origin, &parentWithView);
if (NS_FAILED(result))
return NS_OK;//do not handle
@ -5865,7 +5865,8 @@ nsBlockFrame::HandleEvent(nsIPresContext& aPresContext,
pos.mDirection = eDirNext;
pos.mDesiredX = aEvent->point.x;
result = nsFrame::GetNextPrevLineFromeBlockFrame(&pos,
result = nsFrame::GetNextPrevLineFromeBlockFrame(&aPresContext,
&pos,
mainframe,
closestLine-1,
0
@ -5893,20 +5894,22 @@ nsBlockFrame::HandleEvent(nsIPresContext& aPresContext,
NS_IMETHODIMP
nsBlockFrame::GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame)
nsBlockFrame::GetFrameForPoint(nsIPresContext* aPresContext,
const nsPoint& aPoint,
nsIFrame** aFrame)
{
nsresult rv = GetFrameForPointUsing(aPoint, nsnull, aFrame);
nsresult rv = GetFrameForPointUsing(aPresContext, aPoint, nsnull, aFrame);
if (NS_OK == rv) {
return NS_OK;
}
if (nsnull != mBullet) {
rv = GetFrameForPointUsing(aPoint, nsLayoutAtoms::bulletList, aFrame);
rv = GetFrameForPointUsing(aPresContext, aPoint, nsLayoutAtoms::bulletList, aFrame);
if (NS_OK == rv) {
return NS_OK;
}
}
if (mFloaters.NotEmpty()) {
rv = GetFrameForPointUsing(aPoint, nsLayoutAtoms::floaterList, aFrame);
rv = GetFrameForPointUsing(aPresContext, aPoint, nsLayoutAtoms::floaterList, aFrame);
if (NS_OK == rv) {
return NS_OK;
}
@ -6339,7 +6342,7 @@ nsBlockFrame::ReflowBullet(nsBlockReflowState& aState,
// the final vertical location.
const nsMargin& bp = aState.BorderPadding();
nscoord y = bp.top;
mBullet->SetRect(nsRect(x, y, aMetrics.width, aMetrics.height));
mBullet->SetRect(aState.mPresContext, nsRect(x, y, aMetrics.width, aMetrics.height));
}
//XXX get rid of this -- its slow

Просмотреть файл

@ -1016,7 +1016,7 @@ nsBlockReflowState::RecoverStateFrom(nsLineBox* aLine,
fc->mCombinedArea.y += finalDeltaY;
nsIFrame* floater = fc->mPlaceholder->GetOutOfFlowFrame();
floater->GetRect(r);
floater->MoveTo(r.x, r.y + finalDeltaY);
floater->MoveTo(mPresContext, r.x, r.y + finalDeltaY);
#ifdef DEBUG
if (gNoisyReflow || gNoisySpaceManager) {
nscoord tx, ty;
@ -1161,12 +1161,12 @@ ListTextRuns(FILE* out, PRInt32 aIndent, nsTextRun* aRuns)
}
NS_METHOD
nsBlockFrame::List(FILE* out, PRInt32 aIndent) const
nsBlockFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const
{
IndentBy(out, aIndent);
ListTag(out);
nsIView* view;
GetView(&view);
GetView(aPresContext, &view);
if (nsnull != view) {
fprintf(out, " [view=%p]", view);
}
@ -1211,7 +1211,7 @@ nsBlockFrame::List(FILE* out, PRInt32 aIndent) const
if (nsnull != mLines) {
nsLineBox* line = mLines;
while (nsnull != line) {
line->List(out, aIndent);
line->List(aPresContext, out, aIndent);
line = line->mNext;
}
}
@ -1234,7 +1234,7 @@ nsBlockFrame::List(FILE* out, PRInt32 aIndent) const
}
fputs("<\n", out);
while (nsnull != kid) {
kid->List(out, aIndent + 1);
kid->List(aPresContext, out, aIndent + 1);
kid->GetNextSibling(&kid);
}
IndentBy(out, aIndent);
@ -1416,7 +1416,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext,
ListTag(stdout);
printf(": reflow=initial\n");
#endif
DrainOverflowLines();
DrainOverflowLines(&aPresContext);
rv = PrepareInitialReflow(state);
mState &= ~NS_FRAME_FIRST_REFLOW;
break;
@ -1467,7 +1467,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext,
ListTag(stdout);
printf(": reflow=resize (%d)\n", aReflowState.reason);
#endif
DrainOverflowLines();
DrainOverflowLines(&aPresContext);
rv = PrepareResizeReflow(state);
break;
}
@ -1534,7 +1534,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext,
if (isStyleChange) {
// Lots of things could have changed so damage our entire
// bounds
Invalidate(nsRect(0, 0, mRect.width, mRect.height));
Invalidate(&aPresContext, nsRect(0, 0, mRect.width, mRect.height));
} else {
nsMargin border = aReflowState.mComputedBorderPadding -
@ -1560,7 +1560,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext,
damageRect.y = 0;
damageRect.height = mRect.height;
}
Invalidate(damageRect);
Invalidate(&aPresContext, damageRect);
}
// See if our height changed
@ -1583,7 +1583,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext,
damageRect.y = mRect.height - border.bottom;
damageRect.height = border.bottom;
}
Invalidate(damageRect);
Invalidate(&aPresContext, damageRect);
}
}
}
@ -2429,7 +2429,7 @@ nsBlockFrame::ReflowDirtyLines(nsBlockReflowState& aState)
RecoverStateFrom(aState, line, deltaY, incrementalReflow ?
&damageRect : 0);
if (incrementalReflow && !damageRect.IsEmpty()) {
Invalidate(damageRect);
Invalidate(aState.mPresContext, damageRect);
}
}
@ -2482,7 +2482,7 @@ nsBlockFrame::ReflowDirtyLines(nsBlockReflowState& aState)
frame->SetParent(this);
// When pushing and pulling frames we need to check for whether any
// views need to be reparented
nsHTMLContainerFrame::ReparentFrameView(frame, mNextInFlow, this);
nsHTMLContainerFrame::ReparentFrameView(aState.mPresContext, frame, mNextInFlow, this);
lastFrame = frame;
frame->GetNextSibling(&frame);
}
@ -2602,7 +2602,7 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState,
// XXX We need to improve on this...
nsRect dirtyRect;
dirtyRect.UnionRect(oldCombinedArea, lineCombinedArea);
Invalidate(dirtyRect);
Invalidate(aState.mPresContext, dirtyRect);
} else {
if (oldCombinedArea.width != lineCombinedArea.width) {
@ -2618,7 +2618,7 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState,
dirtyRect.x;
dirtyRect.height = PR_MAX(oldCombinedArea.height,
lineCombinedArea.height);
Invalidate(dirtyRect);
Invalidate(aState.mPresContext, dirtyRect);
}
if (oldCombinedArea.height != lineCombinedArea.height) {
nsRect dirtyRect;
@ -2633,7 +2633,7 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState,
dirtyRect.height = PR_MAX(oldCombinedArea.YMost(),
lineCombinedArea.YMost()) -
dirtyRect.y;
Invalidate(dirtyRect);
Invalidate(aState.mPresContext, dirtyRect);
}
}
}
@ -2649,7 +2649,7 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState,
nsRect dirtyRect;
dirtyRect.UnionRect(oldCombinedArea, combinedArea);
Invalidate(dirtyRect);
Invalidate(aState.mPresContext, dirtyRect);
}
}
@ -2758,7 +2758,7 @@ nsBlockFrame::PullFrame(nsBlockReflowState& aState,
// When pushing and pulling frames we need to check for whether any
// views need to be reparented
NS_ASSERTION(oldParentFrame != this, "unexpected parent frame");
nsHTMLContainerFrame::ReparentFrameView(frame, oldParentFrame, this);
nsHTMLContainerFrame::ReparentFrameView(aState.mPresContext, frame, oldParentFrame, this);
// The frame is being pulled from a next-in-flow; therefore we
// need to add it to our sibling list.
@ -2796,7 +2796,7 @@ nsBlockFrame::SlideLine(nsBlockReflowState& aState,
kid->GetRect(r);
if (aDY) {
r.y += aDY;
kid->SetRect(r);
kid->SetRect(aState.mPresContext, r);
}
// If the child has any floaters that impact the space-manager,
@ -2827,7 +2827,7 @@ nsBlockFrame::SlideLine(nsBlockReflowState& aState,
while (--n >= 0) {
kid->GetRect(r);
r.y += aDY;
kid->SetRect(r);
kid->SetRect(aState.mPresContext, r);
kid->GetNextSibling(&kid);
}
}
@ -3361,7 +3361,7 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState,
nscoord bulletTopMargin = applyTopMargin ? collapsedBottomMargin : 0;
bbox.y = aState.BorderPadding().top + ascent -
metrics.ascent + bulletTopMargin;
mBullet->SetRect(bbox);
mBullet->SetRect(aState.mPresContext, bbox);
}
}
else {
@ -4160,7 +4160,7 @@ nsBlockFrame::PushLines(nsBlockReflowState& aState)
}
PRBool
nsBlockFrame::DrainOverflowLines()
nsBlockFrame::DrainOverflowLines(nsIPresContext* aPresContext)
{
#ifdef DEBUG
VerifyOverflowSituation();
@ -4183,7 +4183,7 @@ nsBlockFrame::DrainOverflowLines()
// When pushing and pulling frames we need to check for whether any
// views need to be reparented
nsHTMLContainerFrame::ReparentFrameView(frame, prevBlock, this);
nsHTMLContainerFrame::ReparentFrameView(aPresContext, frame, prevBlock, this);
// Get the next frame
lastFrame = frame;
@ -4721,7 +4721,7 @@ nsBlockFrame::FixParentAndView(nsIPresContext* aPresContext, nsIFrame* aFrame)
aFrame->GetParent(&oldParent);
aFrame->SetParent(this);
if (this != oldParent) {
nsHTMLContainerFrame::ReparentFrameView(aFrame, oldParent, this);
nsHTMLContainerFrame::ReparentFrameView(aPresContext, aFrame, oldParent, this);
aPresContext->ReParentStyleContext(aFrame, mStyleContext);
}
aFrame->GetNextSibling(&aFrame);
@ -4902,7 +4902,7 @@ nsBlockFrame::DoRemoveFrame(nsIPresContext* aPresContext,
// cases...
nsRect lineCombinedArea;
line->GetCombinedArea(&lineCombinedArea);
Invalidate(lineCombinedArea);
Invalidate(aPresContext, lineCombinedArea);
delete line;
line = next;
}
@ -5063,7 +5063,7 @@ nsBlockFrame::ReflowFloater(nsBlockReflowState& aState,
const nsHTMLReflowMetrics& metrics = brc.GetMetrics();
aCombinedRect = metrics.mCombinedArea;
floater->SizeTo(metrics.width, metrics.height);
floater->SizeTo(aState.mPresContext, metrics.width, metrics.height);
// Stash away the max-element-size for later
aState.StoreMaxElementSize(floater, brc.GetMaxElementSize());
@ -5402,7 +5402,7 @@ nsBlockReflowState::PlaceFloater(nsFloaterCache* aFloaterCache,
x += aFloaterCache->mOffsets.left;
y += aFloaterCache->mOffsets.top;
}
floater->MoveTo(x, y);
floater->MoveTo(mPresContext, x, y);
// Update the floater combined area state
nsRect combinedArea = aFloaterCache->mCombinedArea;
@ -5818,7 +5818,7 @@ nsBlockFrame::HandleEvent(nsIPresContext& aPresContext,
while(NS_SUCCEEDED(result))
{ //we are starting aloop to allow us to "drill down to the one we want"
mainframe->GetOffsetFromView(origin, &parentWithView);
mainframe->GetOffsetFromView(&aPresContext, origin, &parentWithView);
if (NS_FAILED(result))
return NS_OK;//do not handle
@ -5865,7 +5865,8 @@ nsBlockFrame::HandleEvent(nsIPresContext& aPresContext,
pos.mDirection = eDirNext;
pos.mDesiredX = aEvent->point.x;
result = nsFrame::GetNextPrevLineFromeBlockFrame(&pos,
result = nsFrame::GetNextPrevLineFromeBlockFrame(&aPresContext,
&pos,
mainframe,
closestLine-1,
0
@ -5893,20 +5894,22 @@ nsBlockFrame::HandleEvent(nsIPresContext& aPresContext,
NS_IMETHODIMP
nsBlockFrame::GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame)
nsBlockFrame::GetFrameForPoint(nsIPresContext* aPresContext,
const nsPoint& aPoint,
nsIFrame** aFrame)
{
nsresult rv = GetFrameForPointUsing(aPoint, nsnull, aFrame);
nsresult rv = GetFrameForPointUsing(aPresContext, aPoint, nsnull, aFrame);
if (NS_OK == rv) {
return NS_OK;
}
if (nsnull != mBullet) {
rv = GetFrameForPointUsing(aPoint, nsLayoutAtoms::bulletList, aFrame);
rv = GetFrameForPointUsing(aPresContext, aPoint, nsLayoutAtoms::bulletList, aFrame);
if (NS_OK == rv) {
return NS_OK;
}
}
if (mFloaters.NotEmpty()) {
rv = GetFrameForPointUsing(aPoint, nsLayoutAtoms::floaterList, aFrame);
rv = GetFrameForPointUsing(aPresContext, aPoint, nsLayoutAtoms::floaterList, aFrame);
if (NS_OK == rv) {
return NS_OK;
}
@ -6339,7 +6342,7 @@ nsBlockFrame::ReflowBullet(nsBlockReflowState& aState,
// the final vertical location.
const nsMargin& bp = aState.BorderPadding();
nscoord y = bp.top;
mBullet->SetRect(nsRect(x, y, aMetrics.width, aMetrics.height));
mBullet->SetRect(aState.mPresContext, nsRect(x, y, aMetrics.width, aMetrics.height));
}
//XXX get rid of this -- its slow

Просмотреть файл

@ -80,7 +80,7 @@ nsContainerFrame::Destroy(nsIPresContext& aPresContext)
{
// Prevent event dispatch during destruction
nsIView* view;
GetView(&view);
GetView(&aPresContext, &view);
if (nsnull != view) {
view->SetClientData(nsnull);
}
@ -205,7 +205,7 @@ nsContainerFrame::PaintChild(nsIPresContext& aPresContext,
nsFramePaintLayer aWhichLayer)
{
nsIView *pView;
aFrame->GetView(&pView);
aFrame->GetView(&aPresContext, &pView);
if (nsnull == pView) {
nsRect kidRect;
aFrame->GetRect(kidRect);
@ -263,14 +263,16 @@ nsContainerFrame::PaintChild(nsIPresContext& aPresContext,
}
NS_IMETHODIMP
nsContainerFrame::GetFrameForPoint(const nsPoint& aPoint,
nsContainerFrame::GetFrameForPoint(nsIPresContext* aPresContext,
const nsPoint& aPoint,
nsIFrame** aFrame)
{
return GetFrameForPointUsing(aPoint, nsnull, aFrame);
return GetFrameForPointUsing(aPresContext, aPoint, nsnull, aFrame);
}
nsresult
nsContainerFrame::GetFrameForPointUsing(const nsPoint& aPoint,
nsContainerFrame::GetFrameForPointUsing(nsIPresContext* aPresContext,
const nsPoint& aPoint,
nsIAtom* aList,
nsIFrame** aFrame)
{
@ -284,7 +286,7 @@ nsContainerFrame::GetFrameForPointUsing(const nsPoint& aPoint,
kid->GetRect(kidRect);
if (kidRect.Contains(aPoint)) {
tmp.MoveTo(aPoint.x - kidRect.x, aPoint.y - kidRect.y);
return kid->GetFrameForPoint(tmp, aFrame);
return kid->GetFrameForPoint(aPresContext, tmp, aFrame);
}
kid->GetNextSibling(&kid);
}
@ -296,7 +298,7 @@ nsContainerFrame::GetFrameForPointUsing(const nsPoint& aPoint,
if (NS_FRAME_OUTSIDE_CHILDREN & state) {
kid->GetRect(kidRect);
tmp.MoveTo(aPoint.x - kidRect.x, aPoint.y - kidRect.y);
if (NS_OK == kid->GetFrameForPoint(tmp, aFrame)) {
if (NS_OK == kid->GetFrameForPoint(aPresContext, tmp, aFrame)) {
return NS_OK;
}
else {
@ -561,7 +563,7 @@ nsContainerFrame::PushChildren(nsIPresContext* aPresContext,
// When pushing and pulling frames we need to check for whether any
// views need to be reparented.
for (nsIFrame* f = aFromChild; f; f->GetNextSibling(&f)) {
nsHTMLContainerFrame::ReparentFrameView(f, this, mNextInFlow);
nsHTMLContainerFrame::ReparentFrameView(aPresContext, f, this, mNextInFlow);
}
nextInFlow->mFrames.InsertFrames(mNextInFlow, nsnull, aFromChild);
}
@ -594,7 +596,7 @@ nsContainerFrame::MoveOverflowToChildList(nsIPresContext* aPresContext)
// When pushing and pulling frames we need to check for whether any
// views need to be reparented.
for (nsIFrame* f = prevOverflowFrames; f; f->GetNextSibling(&f)) {
nsHTMLContainerFrame::ReparentFrameView(f, prevInFlow, this);
nsHTMLContainerFrame::ReparentFrameView(aPresContext, f, prevInFlow, this);
}
mFrames.InsertFrames(this, nsnull, prevOverflowFrames);
result = PR_TRUE;
@ -615,12 +617,12 @@ nsContainerFrame::MoveOverflowToChildList(nsIPresContext* aPresContext)
// Debugging
NS_IMETHODIMP
nsContainerFrame::List(FILE* out, PRInt32 aIndent) const
nsContainerFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const
{
IndentBy(out, aIndent);
ListTag(out);
nsIView* view;
GetView(&view);
GetView(aPresContext, &view);
if (nsnull != view) {
fprintf(out, " [view=%p]", view);
}
@ -658,7 +660,7 @@ nsContainerFrame::List(FILE* out, PRInt32 aIndent) const
}
fputs("<\n", out);
while (nsnull != kid) {
kid->List(out, aIndent + 1);
kid->List(aPresContext, out, aIndent + 1);
kid->GetNextSibling(&kid);
}
IndentBy(out, aIndent);

Просмотреть файл

@ -37,14 +37,15 @@ public:
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer);
NS_IMETHOD GetFrameForPoint(const nsPoint& aPoint,
nsIFrame** aFrame);
NS_IMETHOD GetFrameForPoint(nsIPresContext* aPresContext,
const nsPoint& aPoint,
nsIFrame** aFrame);
NS_IMETHOD ReplaceFrame(nsIPresContext& aPresContext,
nsIPresShell& aPresShell,
nsIAtom* aListName,
nsIFrame* aOldFrame,
nsIFrame* aNewFrame);
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const;
NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
#endif
@ -66,7 +67,8 @@ protected:
nsContainerFrame();
~nsContainerFrame();
nsresult GetFrameForPointUsing(const nsPoint& aPoint,
nsresult GetFrameForPointUsing(nsIPresContext* aPresContext,
const nsPoint& aPoint,
nsIAtom* aList,
nsIFrame** aFrame);

Просмотреть файл

@ -216,8 +216,8 @@ nsFirstLetterFrame::Reflow(nsIPresContext& aPresContext,
}
// Place and size the child and update the output metrics
kid->MoveTo(bp.left, bp.top);
kid->SizeTo(aMetrics.width, aMetrics.height);
kid->MoveTo(&aPresContext, bp.left, bp.top);
kid->SizeTo(&aPresContext, aMetrics.width, aMetrics.height);
aMetrics.width += lr;
aMetrics.height += tb;
if (aMetrics.maxElementSize) {
@ -278,7 +278,7 @@ nsFirstLetterFrame::DrainOverflowFrames(nsIPresContext* aPresContext)
// views need to be reparented.
nsIFrame* f = overflowFrames;
while (f) {
nsHTMLContainerFrame::ReparentFrameView(f, prevInFlow, this);
nsHTMLContainerFrame::ReparentFrameView(aPresContext, f, prevInFlow, this);
f->GetNextSibling(&f);
}
mFrames.InsertFrames(this, nsnull, overflowFrames);

Просмотреть файл

@ -77,7 +77,7 @@ static NS_DEFINE_IID(kCTransferableCID, NS_TRANSFERABLE_CID);
#include "nsICaret.h"
#include "nsILineIterator.h"
// [HACK] Foward Declarations
void ForceDrawFrame(nsFrame * aFrame);
void ForceDrawFrame(nsIPresContext* aPresContext, nsFrame * aFrame);
//non Hack prototypes
#if 0
static void RefreshContentFrames(nsIPresContext& aPresContext, nsIContent * aStartContent, nsIContent * aEndContent);
@ -487,14 +487,15 @@ NS_IMETHODIMP nsFrame::GetSize(nsSize& aSize) const
return NS_OK;
}
NS_IMETHODIMP nsFrame::SetRect(const nsRect& aRect)
NS_IMETHODIMP nsFrame::SetRect(nsIPresContext* aPresContext,
const nsRect& aRect)
{
MoveTo(aRect.x, aRect.y);
SizeTo(aRect.width, aRect.height);
MoveTo(aPresContext, aRect.x, aRect.y);
SizeTo(aPresContext, aRect.width, aRect.height);
return NS_OK;
}
NS_IMETHODIMP nsFrame::MoveTo(nscoord aX, nscoord aY)
NS_IMETHODIMP nsFrame::MoveTo(nsIPresContext* aPresContext, nscoord aX, nscoord aY)
{
mRect.x = aX;
mRect.y = aY;
@ -509,7 +510,7 @@ NS_IMETHODIMP nsFrame::MoveTo(nscoord aX, nscoord aY)
// parent frame (our parent frame may not have a view).
nsIView* parentWithView;
nsPoint origin;
GetOffsetFromView(origin, &parentWithView);
GetOffsetFromView(aPresContext, origin, &parentWithView);
nsIViewManager *vm;
mView->GetViewManager(vm);
vm->MoveViewTo(mView, origin.x, origin.y);
@ -520,7 +521,7 @@ NS_IMETHODIMP nsFrame::MoveTo(nscoord aX, nscoord aY)
return NS_OK;
}
NS_IMETHODIMP nsFrame::SizeTo(nscoord aWidth, nscoord aHeight)
NS_IMETHODIMP nsFrame::SizeTo(nsIPresContext* aPresContext, nscoord aWidth, nscoord aHeight)
{
mRect.width = aWidth;
mRect.height = aHeight;
@ -881,7 +882,7 @@ nsFrame::HandleMultiplePress(nsIPresContext& aPresContext,
PR_FALSE,
PR_TRUE,
PR_TRUE);
rv = PeekOffset(&startpos);
rv = PeekOffset(&aPresContext, &startpos);
if (NS_FAILED(rv))
return rv;
nsPeekOffsetStruct endpos;
@ -893,7 +894,7 @@ nsFrame::HandleMultiplePress(nsIPresContext& aPresContext,
PR_FALSE,
PR_FALSE,
PR_TRUE);
rv = PeekOffset(&endpos);
rv = PeekOffset(&aPresContext, &endpos);
if (NS_FAILED(rv))
return rv;
@ -996,7 +997,7 @@ nsresult nsFrame::GetContentAndOffsetsFromPoint(nsIPresContext& aCX,
nsIFrame *kid = nsnull;
nsIFrame *closestFrame = nsnull;
result = GetClosestViewForFrame(this, &view);
result = GetClosestViewForFrame(&aCX, this, &view);
if (NS_FAILED(result))
return result;
@ -1016,7 +1017,7 @@ nsresult nsFrame::GetContentAndOffsetsFromPoint(nsIPresContext& aCX,
nsIView * kidView = nsnull;
kid->GetRect(rect);
kid->GetOffsetFromView(offsetPoint, &kidView);
kid->GetOffsetFromView(&aCX, offsetPoint, &kidView);
rect.x = offsetPoint.x;
rect.y = offsetPoint.y;
@ -1063,7 +1064,7 @@ nsresult nsFrame::GetContentAndOffsetsFromPoint(nsIPresContext& aCX,
nsPoint newPoint = aPoint;
nsIView *closestView = nsnull;
result = GetClosestViewForFrame(closestFrame, &closestView);
result = GetClosestViewForFrame(&aCX, closestFrame, &closestView);
if (NS_FAILED(result))
return result;
@ -1094,7 +1095,7 @@ nsresult nsFrame::GetContentAndOffsetsFromPoint(nsIPresContext& aCX,
if (NS_FAILED(result))
return result;
nsPoint offsetPoint;
GetOffsetFromView(offsetPoint, &view);
GetOffsetFromView(&aCX, offsetPoint, &view);
thisRect.x = offsetPoint.x;
thisRect.y = offsetPoint.y;
@ -1140,7 +1141,9 @@ nsFrame::GetCursor(nsIPresContext& aPresContext,
}
NS_IMETHODIMP
nsFrame::GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame)
nsFrame::GetFrameForPoint(nsIPresContext* aPresContext,
const nsPoint& aPoint,
nsIFrame** aFrame)
{
*aFrame = this;
return NS_OK;
@ -1193,7 +1196,7 @@ nsFrame::DidReflow(nsIPresContext& aPresContext,
// parent frame (our parent frame may not have a view).
nsIView* parentWithView;
nsPoint origin;
GetOffsetFromView(origin, &parentWithView);
GetOffsetFromView(&aPresContext, origin, &parentWithView);
vm->ResizeView(mView, mRect.width, mRect.height);
vm->MoveViewTo(mView, origin.x, origin.y);
}
@ -1419,14 +1422,14 @@ NS_IMETHODIMP nsFrame::SetNextInFlow(nsIFrame*)
}
// Associated view object
NS_IMETHODIMP nsFrame::GetView(nsIView** aView) const
NS_IMETHODIMP nsFrame::GetView(nsIPresContext* aPresContext, nsIView** aView) const
{
NS_PRECONDITION(nsnull != aView, "null OUT parameter pointer");
*aView = mView;
return NS_OK;
}
NS_IMETHODIMP nsFrame::SetView(nsIView* aView)
NS_IMETHODIMP nsFrame::SetView(nsIPresContext* aPresContext, nsIView* aView)
{
nsresult rv;
@ -1442,7 +1445,8 @@ NS_IMETHODIMP nsFrame::SetView(nsIView* aView)
}
// Find the first geometric parent that has a view
NS_IMETHODIMP nsFrame::GetParentWithView(nsIFrame** aParent) const
NS_IMETHODIMP nsFrame::GetParentWithView(nsIPresContext* aPresContext,
nsIFrame** aParent) const
{
NS_PRECONDITION(nsnull != aParent, "null OUT parameter pointer");
@ -1450,7 +1454,7 @@ NS_IMETHODIMP nsFrame::GetParentWithView(nsIFrame** aParent) const
for (parent = mParent; nsnull != parent; parent->GetParent(&parent)) {
nsIView* parView;
parent->GetView(&parView);
parent->GetView(aPresContext, &parView);
if (nsnull != parView) {
break;
}
@ -1462,7 +1466,9 @@ NS_IMETHODIMP nsFrame::GetParentWithView(nsIFrame** aParent) const
// Returns the offset from this frame to the closest geometric parent that
// has a view. Also returns the containing view or null in case of error
NS_IMETHODIMP nsFrame::GetOffsetFromView(nsPoint& aOffset, nsIView** aView) const
NS_IMETHODIMP nsFrame::GetOffsetFromView(nsIPresContext* aPresContext,
nsPoint& aOffset,
nsIView** aView) const
{
NS_PRECONDITION(nsnull != aView, "null OUT parameter pointer");
nsIFrame* frame = (nsIFrame*)this;
@ -1476,22 +1482,23 @@ NS_IMETHODIMP nsFrame::GetOffsetFromView(nsPoint& aOffset, nsIView** aView) cons
aOffset += origin;
frame->GetParent(&frame);
if (nsnull != frame) {
frame->GetView(aView);
frame->GetView(aPresContext, aView);
}
} while ((nsnull != frame) && (nsnull == *aView));
return NS_OK;
}
NS_IMETHODIMP nsFrame::GetWindow(nsIWidget** aWindow) const
NS_IMETHODIMP nsFrame::GetWindow(nsIPresContext* aPresContext,
nsIWidget** aWindow) const
{
NS_PRECONDITION(nsnull != aWindow, "null OUT parameter pointer");
nsIFrame* frame;
nsIWidget* window = nsnull;
for (frame = (nsIFrame*)this; nsnull != frame; frame->GetParentWithView(&frame)) {
for (frame = (nsIFrame*)this; nsnull != frame; frame->GetParentWithView(aPresContext, &frame)) {
nsIView* view;
frame->GetView(&view);
frame->GetView(aPresContext, &view);
if (nsnull != view) {
view->GetWidget(window);
if (nsnull != window) {
@ -1513,8 +1520,9 @@ nsFrame::GetFrameType(nsIAtom** aType) const
}
void
nsFrame::Invalidate(const nsRect& aDamageRect,
PRBool aImmediate) const
nsFrame::Invalidate(nsIPresContext* aPresContext,
const nsRect& aDamageRect,
PRBool aImmediate) const
{
nsIViewManager* viewManager = nsnull;
nsRect damageRect(aDamageRect);
@ -1539,7 +1547,7 @@ nsFrame::Invalidate(const nsRect& aDamageRect,
nsPoint offset;
nsIView* view;
GetOffsetFromView(offset, &view);
GetOffsetFromView(aPresContext, offset, &view);
NS_ASSERTION(nsnull != view, "no view");
rect += offset;
view->GetViewManager(viewManager);
@ -1643,7 +1651,7 @@ PRInt32 nsFrame::ContentIndexInContainer(const nsIFrame* aFrame)
// Debugging
NS_IMETHODIMP
nsFrame::List(FILE* out, PRInt32 aIndent) const
nsFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const
{
IndentBy(out, aIndent);
ListTag(out);
@ -1836,7 +1844,7 @@ nsFrame::VerifyTree() const
/*this method may.. invalidate if the state was changed or if aForceRedraw is PR_TRUE
it will not update immediately.*/
NS_IMETHODIMP
nsFrame::SetSelected(nsIDOMRange *aRange,PRBool aSelected, nsSpread aSpread)
nsFrame::SetSelected(nsIPresContext* aPresContext, nsIDOMRange *aRange,PRBool aSelected, nsSpread aSpread)
{
if (aSelected && ParentDisablesSelection())
return NS_OK;
@ -1869,7 +1877,7 @@ nsFrame::SetSelected(nsIDOMRange *aRange,PRBool aSelected, nsSpread aSpread)
nsRect frameRect;
GetRect(frameRect);
nsRect rect(0, 0, frameRect.width, frameRect.height);
Invalidate(rect, PR_FALSE);
Invalidate(aPresContext, rect, PR_FALSE);
#if 0
if (aRange) {
//lets see if the range contains us, if so we must redraw!
@ -1950,7 +1958,8 @@ nsFrame::GetChildFrameContainingOffset(PRInt32 inContentOffset, PRBool inHint, P
}
nsresult
nsFrame::GetNextPrevLineFromeBlockFrame(nsPeekOffsetStruct *aPos,
nsFrame::GetNextPrevLineFromeBlockFrame(nsIPresContext* aPresContext,
nsPeekOffsetStruct *aPos,
nsIFrame *aBlockFrame,
PRInt32 aLineStart,
PRInt8 aOutSideLimit
@ -2029,7 +2038,7 @@ nsFrame::GetNextPrevLineFromeBlockFrame(nsPeekOffsetStruct *aPos,
}
nsPoint offset;
nsIView * view; //used for call of get offset from view
aBlockFrame->GetOffsetFromView(offset,&view);
aBlockFrame->GetOffsetFromView(aPresContext, offset,&view);
nscoord newDesiredX = aPos->mDesiredX - offset.x;//get desired x into blockframe coordinates!
result = it->FindFrameAt(searchingLine, newDesiredX, &resultFrame, &isBeforeFirstFrame, &isAfterLastFrame);
}
@ -2135,7 +2144,7 @@ nsFrame::GetNextPrevLineFromeBlockFrame(nsPeekOffsetStruct *aPos,
aPos->mPreferLeft = !(aPos->mDirection == eDirNext);
if (aPos->mDirection == eDirPrevious)
aPos->mStartOffset = -1;//start from end
return aBlockFrame->PeekOffset(aPos);
return aBlockFrame->PeekOffset(aPresContext, aPos);
}
}
return NS_OK;
@ -2143,7 +2152,7 @@ nsFrame::GetNextPrevLineFromeBlockFrame(nsPeekOffsetStruct *aPos,
NS_IMETHODIMP
nsFrame::PeekOffset(nsPeekOffsetStruct *aPos)
nsFrame::PeekOffset(nsIPresContext* aPresContext, nsPeekOffsetStruct *aPos)
{
if (!aPos || !aPos->mTracker )
return NS_ERROR_NULL_POINTER;
@ -2177,7 +2186,7 @@ nsFrame::PeekOffset(nsPeekOffsetStruct *aPos)
{
return result?result:NS_ERROR_FAILURE;
}
return aPos->mResultFrame->PeekOffset(aPos);
return aPos->mResultFrame->PeekOffset(aPresContext, aPos);
}
else
{
@ -2235,7 +2244,8 @@ nsFrame::PeekOffset(nsPeekOffsetStruct *aPos)
//it will "drill down" to find a viable frame or it will return an error.
do {
result = GetNextPrevLineFromeBlockFrame(aPos,
result = GetNextPrevLineFromeBlockFrame(aPresContext,
aPos,
blockFrame,
thisLine,
edgeCase //start from thisLine
@ -2313,7 +2323,7 @@ nsFrame::PeekOffset(nsPeekOffsetStruct *aPos)
{
nsPoint offsetPoint; //used for offset of result frame
nsIView * view; //used for call of get offset from view
firstFrame->GetOffsetFromView(offsetPoint, &view);
firstFrame->GetOffsetFromView(aPresContext, offsetPoint, &view);
offsetPoint.x = 0;//all the way to the left
result = firstFrame->GetContentAndOffsetsFromPoint(*(context.get()),
@ -2337,7 +2347,7 @@ nsFrame::PeekOffset(nsPeekOffsetStruct *aPos)
nsPoint offsetPoint; //used for offset of result frame
nsIView * view; //used for call of get offset from view
nextFrame->GetOffsetFromView(offsetPoint, &view);
nextFrame->GetOffsetFromView(aPresContext, offsetPoint, &view);
offsetPoint.x = 2* usedRect.width; //2* just to be sure we are off the edge
@ -2363,7 +2373,7 @@ nsFrame::PeekOffset(nsPeekOffsetStruct *aPos)
default:
{
if (NS_SUCCEEDED(result))
result = aPos->mResultFrame->PeekOffset(aPos);
result = aPos->mResultFrame->PeekOffset(aPresContext, aPos);
}
}
return result;
@ -2497,7 +2507,9 @@ nsFrame::GetFrameFromDirection(nsPeekOffsetStruct *aPos)
return NS_OK;
}
nsresult nsFrame::GetClosestViewForFrame(nsIFrame *aFrame, nsIView **aView)
nsresult nsFrame::GetClosestViewForFrame(nsIPresContext* aPresContext,
nsIFrame *aFrame,
nsIView **aView)
{
if (!aView)
return NS_ERROR_NULL_POINTER;
@ -2510,7 +2522,7 @@ nsresult nsFrame::GetClosestViewForFrame(nsIFrame *aFrame, nsIView **aView)
while (parent && !*aView)
{
result = parent->GetView(aView);
result = parent->GetView(aPresContext, aView);
if (NS_FAILED(result))
return result;
@ -2533,18 +2545,18 @@ nsresult nsFrame::GetClosestViewForFrame(nsIFrame *aFrame, nsIView **aView)
/********************************************************
* Refreshes each content's frame
*********************************************************/
static void RefreshAllContentFrames(nsIFrame * aFrame, nsIContent * aContent)
static void RefreshAllContentFrames(nsIPresContext* aPresContext, nsIFrame * aFrame, nsIContent * aContent)
{
nsIContent* frameContent;
aFrame->GetContent(&frameContent);
if (frameContent == aContent) {
ForceDrawFrame((nsFrame *)aFrame);
ForceDrawFrame(aPresContext, (nsFrame *)aFrame);
}
NS_IF_RELEASE(frameContent);
aFrame->FirstChild(nsnull, &aFrame);
while (aFrame) {
RefreshAllContentFrames(aFrame, aContent);
RefreshAllContentFrames(aPresContext, aFrame, aContent);
aFrame->GetNextSibling(&aFrame);
}
}
@ -2556,7 +2568,7 @@ static void RefreshAllContentFrames(nsIFrame * aFrame, nsIContent * aContent)
/**
*
*/
void ForceDrawFrame(nsFrame * aFrame)//, PRBool)
void ForceDrawFrame(nsIPresContext* aPresContext, nsFrame * aFrame)//, PRBool)
{
if (aFrame == nsnull) {
return;
@ -2564,7 +2576,7 @@ void ForceDrawFrame(nsFrame * aFrame)//, PRBool)
nsRect rect;
nsIView * view;
nsPoint pnt;
aFrame->GetOffsetFromView(pnt, &view);
aFrame->GetOffsetFromView(aPresContext, pnt, &view);
aFrame->GetRect(rect);
rect.x = pnt.x;
rect.y = pnt.y;

Просмотреть файл

@ -151,9 +151,9 @@ public:
NS_IMETHOD GetRect(nsRect& aRect) const;
NS_IMETHOD GetOrigin(nsPoint& aPoint) const;
NS_IMETHOD GetSize(nsSize& aSize) const;
NS_IMETHOD SetRect(const nsRect& aRect);
NS_IMETHOD MoveTo(nscoord aX, nscoord aY);
NS_IMETHOD SizeTo(nscoord aWidth, nscoord aHeight);
NS_IMETHOD SetRect(nsIPresContext* aPresContext, const nsRect& aRect);
NS_IMETHOD MoveTo(nsIPresContext* aPresContext, nscoord aX, nscoord aY);
NS_IMETHOD SizeTo(nsIPresContext* aPresContext, nscoord aWidth, nscoord aHeight);
NS_IMETHOD GetAdditionalChildListName(PRInt32 aIndex, nsIAtom** aListName) const;
NS_IMETHOD FirstChild(nsIAtom* aListName, nsIFrame** aFirstChild) const;
NS_IMETHOD Paint(nsIPresContext& aPresContext,
@ -166,8 +166,9 @@ public:
NS_IMETHOD GetCursor(nsIPresContext& aPresContext,
nsPoint& aPoint,
PRInt32& aCursor);
NS_IMETHOD GetFrameForPoint(const nsPoint& aPoint,
nsIFrame** aFrame);
NS_IMETHOD GetFrameForPoint(nsIPresContext* aPresContext,
const nsPoint& aPoint,
nsIFrame** aFrame);
NS_IMETHOD GetPointFromOffset(nsIPresContext* inPresContext,
nsIRenderingContext* inRendContext,
@ -179,7 +180,8 @@ public:
PRInt32* outFrameContentOffset,
nsIFrame* *outChildFrame);
static nsresult GetNextPrevLineFromeBlockFrame(nsPeekOffsetStruct *aPos,
static nsresult GetNextPrevLineFromeBlockFrame(nsIPresContext* aPresContext,
nsPeekOffsetStruct *aPos,
nsIFrame *aBlockFrame,
PRInt32 aLineStart,
PRInt8 aOutSideLimit
@ -204,24 +206,24 @@ public:
NS_IMETHOD SetPrevInFlow(nsIFrame*);
NS_IMETHOD GetNextInFlow(nsIFrame** aNextInFlow) const;
NS_IMETHOD SetNextInFlow(nsIFrame*);
NS_IMETHOD GetView(nsIView** aView) const;
NS_IMETHOD SetView(nsIView* aView);
NS_IMETHOD GetParentWithView(nsIFrame** aParent) const;
NS_IMETHOD GetOffsetFromView(nsPoint& aOffset, nsIView** aView) const;
NS_IMETHOD GetWindow(nsIWidget**) const;
NS_IMETHOD GetView(nsIPresContext* aPresContext, nsIView** aView) const;
NS_IMETHOD SetView(nsIPresContext* aPresContext, nsIView* aView);
NS_IMETHOD GetParentWithView(nsIPresContext* aPresContext, nsIFrame** aParent) const;
NS_IMETHOD GetOffsetFromView(nsIPresContext* aPresContext, nsPoint& aOffset, nsIView** aView) const;
NS_IMETHOD GetWindow(nsIPresContext* aPresContext, nsIWidget**) const;
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
NS_IMETHOD IsPercentageBase(PRBool& aBase) const;
NS_IMETHOD GetNextSibling(nsIFrame** aNextSibling) const;
NS_IMETHOD SetNextSibling(nsIFrame* aNextSibling);
NS_IMETHOD Scrolled(nsIView *aView);
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const;
NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
NS_IMETHOD DumpRegressionData(FILE* out, PRInt32 aIndent);
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
NS_IMETHOD VerifyTree() const;
NS_IMETHOD SetSelected(nsIDOMRange *aRange,PRBool aSelected, nsSpread aSpread);
NS_IMETHOD SetSelected(nsIPresContext* aPresContext, nsIDOMRange *aRange,PRBool aSelected, nsSpread aSpread);
NS_IMETHOD GetSelected(PRBool *aSelected) const;
NS_IMETHOD PeekOffset(nsPeekOffsetStruct *aPos) ;
NS_IMETHOD PeekOffset(nsIPresContext* aPresContext, nsPeekOffsetStruct *aPos) ;
NS_IMETHOD GetOffsets(PRInt32 &aStart, PRInt32 &aEnd) const;
@ -272,7 +274,8 @@ public:
// Invalidate part of the frame by asking the view manager to repaint.
// aDamageRect is in the frame's local coordinate space
void Invalidate(const nsRect& aDamageRect,
void Invalidate(nsIPresContext* aPresContext,
const nsRect& aDamageRect,
PRBool aImmediate = PR_FALSE) const;
// Helper function to return the index in parent of the frame's content
@ -287,7 +290,9 @@ public:
PRBool IsFrameTreeTooDeep(const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aMetrics);
virtual nsresult GetClosestViewForFrame(nsIFrame *aFrame, nsIView **aView);
virtual nsresult GetClosestViewForFrame(nsIPresContext* aPresContext,
nsIFrame *aFrame,
nsIView **aView);
#ifdef NS_DEBUG
/**

Просмотреть файл

@ -158,9 +158,6 @@ public:
NS_IMETHOD DidReflow(nsIPresContext& aPresContext,
nsDidReflowStatus aStatus);
NS_IMETHOD MoveTo(nscoord aX, nscoord aY);
NS_IMETHOD SizeTo(nscoord aWidth, nscoord aHeight);
NS_IMETHOD GetParentContent(nsIContent*& aContent);
PRBool GetURL(nsIContent* aContent, nsString& aResult);
PRBool GetName(nsIContent* aContent, nsString& aResult);
@ -361,7 +358,7 @@ nsHTMLFrameOuterFrame::Reflow(nsIPresContext& aPresContext,
// Place and size the child
nsRect rect(offset.x, offset.y, innerSize.width, innerSize.height);
firstChild->SetRect(rect);
firstChild->SetRect(&aPresContext, rect);
}
// XXX what should the max-element-size of an iframe be? Shouldn't
@ -587,18 +584,6 @@ nsHTMLFrameInnerFrame::GetFrameType(nsIAtom** aType) const
return NS_OK;
}
NS_METHOD
nsHTMLFrameInnerFrame::MoveTo(nscoord aX, nscoord aY)
{
return nsLeafFrame::MoveTo(aX, aY);
}
NS_METHOD
nsHTMLFrameInnerFrame::SizeTo(nscoord aWidth, nscoord aHeight)
{
return nsLeafFrame::SizeTo(aWidth, aHeight);
}
NS_IMETHODIMP
nsHTMLFrameInnerFrame::Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,
@ -668,7 +653,7 @@ nsHTMLFrameInnerFrame::DidReflow(nsIPresContext& aPresContext,
// positioned then we show it.
if (NS_FRAME_REFLOW_FINISHED == aStatus) {
nsIView* view = nsnull;
GetView(&view);
GetView(&aPresContext, &view);
if (view) {
const nsStyleDisplay* display;
GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)display));
@ -811,7 +796,7 @@ nsHTMLFrameInnerFrame::CreateWebShell(nsIPresContext& aPresContext,
nsIView* parView;
nsPoint origin;
GetOffsetFromView(origin, &parView);
GetOffsetFromView(&aPresContext, origin, &parView);
nsRect viewBounds(origin.x, origin.y, aSize.width, aSize.height);
nsCOMPtr<nsIViewManager> viewMan;
@ -819,7 +804,7 @@ nsHTMLFrameInnerFrame::CreateWebShell(nsIPresContext& aPresContext,
rv = view->Init(viewMan, viewBounds, parView);
viewMan->InsertChild(parView, view, 0);
rv = view->CreateWidget(kCChildCID);
SetView(view);
SetView(&aPresContext, view);
// if the visibility is hidden, reflect that in the view
const nsStyleDisplay* display;

Просмотреть файл

@ -346,12 +346,12 @@ nsFrameList::VerifyParent(nsIFrame* aParent) const
}
void
nsFrameList::List(FILE* out) const
nsFrameList::List(nsIPresContext* aPresContext, FILE* out) const
{
fputs("<\n", out);
nsIFrame* frame = mFirstChild;
while (nsnull != frame) {
frame->List(out, 1);
frame->List(aPresContext, out, 1);
frame->GetNextSibling(&frame);
}
fputs(">\n", out);

Просмотреть файл

@ -121,7 +121,7 @@ public:
void VerifyParent(nsIFrame* aParent) const;
void List(FILE* out) const;
void List(nsIPresContext* aPresContext, FILE* out) const;
protected:
nsIFrame* mFirstChild;

Просмотреть файл

@ -108,7 +108,8 @@ public:
nsGUIEvent* aEvent,
nsEventStatus& aEventStatus);
NS_IMETHOD GetFrameForPoint(const nsPoint& aPoint,
NS_IMETHOD GetFrameForPoint(nsIPresContext* aPresContext,
const nsPoint& aPoint,
nsIFrame** aFrame);
NS_IMETHOD GetCursor(nsIPresContext& aPresContext,
@ -152,7 +153,7 @@ protected:
class nsHTMLFramesetBlankFrame : public nsLeafFrame {
public:
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const;
NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out = stdout, PRInt32 aIndent = 0) const;
NS_IMETHOD Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,
@ -546,7 +547,7 @@ NS_METHOD nsHTMLFramesetFrame::HandleEvent(nsIPresContext& aPresContext,
MouseDrag(aPresContext, aEvent);
break;
case NS_MOUSE_LEFT_BUTTON_UP:
EndMouseDrag();
EndMouseDrag(&aPresContext);
break;
}
aEventStatus = nsEventStatus_eConsumeNoDefault;
@ -594,7 +595,8 @@ nsHTMLFramesetFrame::GetCursor(nsIPresContext& aPresContext,
}
NS_IMETHODIMP
nsHTMLFramesetFrame::GetFrameForPoint(const nsPoint& aPoint,
nsHTMLFramesetFrame::GetFrameForPoint(nsIPresContext* aPresContext,
const nsPoint& aPoint,
nsIFrame** aFrame)
{
//XXX Temporary to deal with event handling in both this and FramsetBorderFrame
@ -602,7 +604,7 @@ nsHTMLFramesetFrame::GetFrameForPoint(const nsPoint& aPoint,
*aFrame = this;
return NS_OK;
} else {
return nsContainerFrame::GetFrameForPoint(aPoint, aFrame);
return nsContainerFrame::GetFrameForPoint(aPresContext, aPoint, aFrame);
}
}
@ -782,7 +784,7 @@ nsHTMLFramesetFrame::ReflowPlaceChild(nsIFrame* aChild,
// Place and size the child
nsRect rect(aOffset.x, aOffset.y, aSize.width, aSize.height);
aChild->SetRect(rect);
aChild->SetRect(&aPresContext, rect);
htmlReflow->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED); // this call is needed
}
}
@ -923,12 +925,12 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
nsIFrame* parWithView;
nsIView *parView;
GetParentWithView(&parWithView);
parWithView->GetView(&parView);
GetParentWithView(&aPresContext, &parWithView);
parWithView->GetView(&aPresContext, &parView);
nsRect boundBox(0, 0, aDesiredSize.width, aDesiredSize.height);
result = view->Init(viewMan, boundBox, parView, nsnull);
viewMan->InsertChild(parView, view, 0);
SetView(view);
SetView(&aPresContext, view);
// parse the rows= cols= data
ParseRowCol(nsHTMLAtoms::rows, mNumRows, &mRowSpecs);
@ -1417,7 +1419,7 @@ nsHTMLFramesetFrame::StartMouseDrag(nsIPresContext& aPresContext,
NS_ASSERTION((nsnull != aBorder) && (index >= 0), "invalid dragger");
#endif
nsIView* view;
GetView(&view);
GetView(&aPresContext, &view);
if (view) {
nsIViewManager* viewMan;
view->GetViewManager(viewMan);
@ -1491,10 +1493,10 @@ nsHTMLFramesetFrame::MouseDrag(nsIPresContext& aPresContext,
}
void
nsHTMLFramesetFrame::EndMouseDrag()
nsHTMLFramesetFrame::EndMouseDrag(nsIPresContext* aPresContext)
{
nsIView* view;
GetView(&view);
GetView(aPresContext, &view);
if (view) {
nsIViewManager* viewMan;
view->GetViewManager(viewMan);
@ -1693,7 +1695,8 @@ nsHTMLFramesetBorderFrame::HandleEvent(nsIPresContext& aPresContext,
}
NS_IMETHODIMP
nsHTMLFramesetBorderFrame::GetFrameForPoint(const nsPoint& aPoint,
nsHTMLFramesetBorderFrame::GetFrameForPoint(nsIPresContext* aPresContext,
const nsPoint& aPoint,
nsIFrame** aFrame)
{
*aFrame = this;
@ -1781,11 +1784,12 @@ nsHTMLFramesetBlankFrame::Paint(nsIPresContext& aPresContext,
}
NS_IMETHODIMP nsHTMLFramesetBlankFrame::List(FILE* out,
NS_IMETHODIMP nsHTMLFramesetBlankFrame::List(nsIPresContext* aPresContext,
FILE* out,
PRInt32 aIndent) const
{
for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out); // Indent
fprintf(out, "%p BLANK \n", this);
return nsLeafFrame::List(out, aIndent);
return nsLeafFrame::List(aPresContext, out, aIndent);
}

Просмотреть файл

@ -123,7 +123,8 @@ public:
nsGUIEvent* aEvent,
nsEventStatus& aEventStatus);
NS_IMETHOD GetFrameForPoint(const nsPoint& aPoint,
NS_IMETHOD GetFrameForPoint(nsIPresContext* aPresContext,
const nsPoint& aPoint,
nsIFrame** aFrame);
NS_IMETHOD GetCursor(nsIPresContext& aPresContext,
@ -149,7 +150,7 @@ public:
void MouseDrag(nsIPresContext& aPresContext,
nsGUIEvent* aEvent);
void EndMouseDrag();
void EndMouseDrag(nsIPresContext* aPresContext);
nsFrameborder GetParentFrameborder() { return mParentFrameborder; }

Просмотреть файл

@ -136,7 +136,8 @@ public:
nsresult GetFrameSize( nsIFrame* aFrame,
nsSize& aSize);
nsresult SetFrameSize( nsIFrame* aFrame,
nsresult SetFrameSize( nsIPresContext* aPresContext,
nsIFrame* aFrame,
nsSize aSize);
nsresult CalculateScrollAreaSize(nsIPresContext& aPresContext,
@ -203,11 +204,11 @@ public:
void AddVerticalScrollbar (const nsSize& aSbSize, nsSize& aScrollAreaSize);
void RemoveHorizontalScrollbar(const nsSize& aSbSize, nsSize& aScrollAreaSize);
void RemoveVerticalScrollbar (const nsSize& aSbSize, nsSize& aScrollAreaSize);
nsIScrollableView* GetScrollableView();
nsIScrollableView* GetScrollableView(nsIPresContext* aPresContext);
void GetScrolledContentSize(nsSize& aSize);
void ScrollbarChanged(nscoord aX, nscoord aY);
void ScrollbarChanged(nsIPresContext* aPresContext, nscoord aX, nscoord aY);
nsresult GetContentOf(nsIFrame* aFrame, nsIContent** aContent);
nsIFrame* mHScrollbarFrame;
@ -246,12 +247,14 @@ nsGfxScrollFrame::nsGfxScrollFrame(nsIDocument* aDocument)
mInner = new nsGfxScrollFrameInner(this);
mInner->AddRef();
mInner->mDocument = aDocument;
mPresContext = nsnull;
}
nsGfxScrollFrame::~nsGfxScrollFrame()
{
mInner->mOuter = nsnull;
mInner->Release();
mPresContext = nsnull;
}
nsresult NS_CreateAnonymousNode(nsIContent* aParent, nsIAtom* aTag, PRInt32 aNameSpaceId, nsCOMPtr<nsIContent>& aNewNode);
@ -313,6 +316,7 @@ nsGfxScrollFrame::Init(nsIPresContext& aPresContext,
nsIStyleContext* aStyleContext,
nsIFrame* aPrevInFlow)
{
mPresContext = &aPresContext;
nsresult rv = nsHTMLContainerFrame::Init(aPresContext, aContent,
aParent, aStyleContext,
aPrevInFlow);
@ -342,7 +346,7 @@ nsGfxScrollFrame::SetInitialChildList(nsIPresContext& aPresContext,
mInner->mHScrollbarFrame->GetNextSibling(&mInner->mVScrollbarFrame);
// listen for scroll events.
mInner->GetScrollableView()->AddScrollPositionListener(mInner);
mInner->GetScrollableView(&aPresContext)->AddScrollPositionListener(mInner);
return rv;
}
@ -470,7 +474,7 @@ nsGfxScrollFrame::Reflow(nsIPresContext& aPresContext,
// redraw anything that needs it.
if ( aReflowState.reason == eReflowReason_Incremental )
if (hscrollbarNeedsReflow && vscrollbarNeedsReflow && scrollAreaNeedsReflow)
Invalidate(nsRect(0,0,mRect.width,mRect.height), PR_FALSE);
Invalidate(&aPresContext, nsRect(0,0,mRect.width,mRect.height), PR_FALSE);
mInner->mHscrollbarNeedsReflow = PR_FALSE;
@ -643,7 +647,7 @@ nsGfxScrollFrameInner::nsGfxScrollFrameInner(nsGfxScrollFrame* aOuter):mHScrollb
mScrollAreaFrame(nsnull),
mHasVerticalScrollbar(PR_FALSE),
mHasHorizontalScrollbar(PR_FALSE),
mOnePixel(20)
mOnePixel(20)
{
mOuter = aOuter;
mRefCnt = 0;
@ -674,10 +678,10 @@ nsGfxScrollFrameInner::ScrollPositionDidChange(nsIScrollableView* aScrollable, n
NS_IMETHODIMP
nsGfxScrollFrameInner::AttributeChanged(nsIDocument *aDocument,
nsIContent* aContent,
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aHint)
nsIContent* aContent,
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aHint)
{
if (mHScrollbarFrame && mVScrollbarFrame)
{
@ -709,7 +713,7 @@ nsGfxScrollFrameInner::AttributeChanged(nsIDocument *aDocument,
y = value.ToInteger(&error);
}
ScrollbarChanged(x*mOnePixel, y*mOnePixel);
ScrollbarChanged(mOuter->mPresContext, x*mOnePixel, y*mOnePixel);
}
}
@ -718,11 +722,11 @@ nsGfxScrollFrameInner::AttributeChanged(nsIDocument *aDocument,
nsIScrollableView*
nsGfxScrollFrameInner::GetScrollableView()
nsGfxScrollFrameInner::GetScrollableView(nsIPresContext* aPresContext)
{
nsIScrollableView* scrollingView;
nsIView* view;
mScrollAreaFrame->GetView(&view);
mScrollAreaFrame->GetView(aPresContext, &view);
nsresult result = view->QueryInterface(kScrollViewIID, (void**)&scrollingView);
NS_ASSERTION(NS_SUCCEEDED(result), "assertion gfx scrollframe does not contain a scrollframe");
return scrollingView;
@ -743,8 +747,9 @@ nsGfxScrollFrameInner::GetScrolledContentSize(nsSize& aSize)
nsresult
nsGfxScrollFrameInner::SetFrameSize( nsIFrame* aFrame,
nsSize aSize)
nsGfxScrollFrameInner::SetFrameSize(nsIPresContext* aPresContext,
nsIFrame* aFrame,
nsSize aSize)
{
// get the margin
@ -764,7 +769,7 @@ nsGfxScrollFrameInner::SetFrameSize( nsIFrame* aFrame,
aSize.width -= margin.left + margin.right;
aSize.height -= margin.top + margin.bottom;
aFrame->SizeTo(aSize.width, aSize.height);
aFrame->SizeTo(aPresContext, aSize.width, aSize.height);
return NS_OK;
}
@ -1187,7 +1192,7 @@ nsGfxScrollFrameInner::ReflowFrame( nsIPresContext& aPresContext,
// if the frame size change then mark the flag
if (oldSize.width != aDesiredSize.width || oldSize.height != aDesiredSize.height) {
aFrame->SizeTo(aDesiredSize.width, aDesiredSize.height);
aFrame->SizeTo(&aPresContext, aDesiredSize.width, aDesiredSize.height);
aResized = PR_TRUE;
}
@ -1409,7 +1414,7 @@ nsGfxScrollFrameInner::ReflowScrollArea( nsIPresContext& aPresContext
SetAttribute(mHScrollbarFrame, nsXULAtoms::pageincrement, nscoord(float(scrollAreaSize.width)*0.8));
SetAttribute(mVScrollbarFrame, nsXULAtoms::increment, fontHeight);
nsIScrollableView* scrollable = GetScrollableView();
nsIScrollableView* scrollable = GetScrollableView(&aPresContext);
scrollable->SetLineHeight(fontHeight);
SetAttribute(mHScrollbarFrame, nsXULAtoms::increment, 10*mOnePixel);
@ -1418,7 +1423,7 @@ nsGfxScrollFrameInner::ReflowScrollArea( nsIPresContext& aPresContext
// even if it is different from the old size. This is because ReflowFrame set the child's
// frame so we have to make sure our final size is scrollAreaSize
SetFrameSize(mScrollAreaFrame, scrollAreaSize);
SetFrameSize(&aPresContext, mScrollAreaFrame, scrollAreaSize);
}
}
@ -1443,13 +1448,13 @@ nsGfxScrollFrameInner::LayoutChildren(nsIPresContext& aPresContext,
const nsMargin& border = aReflowState.mComputedBorderPadding;
// Place scroll area
mScrollAreaFrame->MoveTo(border.left, border.top);
mScrollAreaFrame->MoveTo(&aPresContext, border.left, border.top);
// place vertical scrollbar
mVScrollbarFrame->MoveTo(border.left + scrollAreaSize.width, border.top);
mVScrollbarFrame->MoveTo(&aPresContext, border.left + scrollAreaSize.width, border.top);
// place horizontal scrollbar
mHScrollbarFrame->MoveTo(border.left, border.top + scrollAreaSize.height);
mHScrollbarFrame->MoveTo(&aPresContext, border.left, border.top + scrollAreaSize.height);
// Compute our desired size
// ---------- compute width -----------
@ -1499,9 +1504,9 @@ nsGfxScrollFrameInner::LayoutChildren(nsIPresContext& aPresContext,
}
void
nsGfxScrollFrameInner::ScrollbarChanged(nscoord aX, nscoord aY)
nsGfxScrollFrameInner::ScrollbarChanged(nsIPresContext* aPresContext, nscoord aX, nscoord aY)
{
nsIScrollableView* scrollable = GetScrollableView();
nsIScrollableView* scrollable = GetScrollableView(aPresContext);
scrollable->ScrollTo(aX,aY, NS_SCROLL_PROPERTY_ALWAYS_BLIT);
// printf("scrolling to: %d, %d\n", aX, aY);
}

Просмотреть файл

@ -116,6 +116,7 @@ protected:
private:
friend class nsGfxScrollFrameInner;
nsGfxScrollFrameInner* mInner;
nsIPresContext* mPresContext; // weak reference
};
#endif /* nsScrollFrame_h___ */

Просмотреть файл

@ -130,7 +130,8 @@ nsHTMLContainerFrame::CreateNextInFlow(nsIPresContext& aPresContext,
}
static nsresult
ReparentFrameViewTo(nsIFrame* aFrame,
ReparentFrameViewTo(nsIPresContext* aPresContext,
nsIFrame* aFrame,
nsIViewManager* aViewManager,
nsIView* aNewParentView,
nsIView* aOldParentView)
@ -138,7 +139,7 @@ ReparentFrameViewTo(nsIFrame* aFrame,
nsIView* view;
// Does aFrame have a view?
aFrame->GetView(&view);
aFrame->GetView(aPresContext, &view);
if (view) {
#ifdef NS_DEBUG
// Verify that the current parent view is what we think it is
@ -163,7 +164,7 @@ ReparentFrameViewTo(nsIFrame* aFrame,
aFrame->FirstChild(nsnull, &childFrame);
while (childFrame) {
ReparentFrameViewTo(childFrame, aViewManager, aNewParentView, aOldParentView);
ReparentFrameViewTo(aPresContext, childFrame, aViewManager, aNewParentView, aOldParentView);
childFrame->GetNextSibling(&childFrame);
}
}
@ -174,13 +175,13 @@ ReparentFrameViewTo(nsIFrame* aFrame,
// Helper function that returns the nearest view to this frame. Checks
// this frame, its parent frame, its parent frame, ...
static nsIView*
GetClosestViewFor(nsIFrame* aFrame)
GetClosestViewFor(nsIPresContext* aPresContext, nsIFrame* aFrame)
{
NS_PRECONDITION(aFrame, "null frame pointer");
nsIView* view;
do {
aFrame->GetView(&view);
aFrame->GetView(aPresContext, &view);
if (view) {
break;
}
@ -192,9 +193,10 @@ GetClosestViewFor(nsIFrame* aFrame)
}
nsresult
nsHTMLContainerFrame::ReparentFrameView(nsIFrame* aChildFrame,
nsIFrame* aOldParentFrame,
nsIFrame* aNewParentFrame)
nsHTMLContainerFrame::ReparentFrameView(nsIPresContext* aPresContext,
nsIFrame* aChildFrame,
nsIFrame* aOldParentFrame,
nsIFrame* aNewParentFrame)
{
NS_PRECONDITION(aChildFrame, "null child frame pointer");
NS_PRECONDITION(aOldParentFrame, "null old parent frame pointer");
@ -207,7 +209,7 @@ nsHTMLContainerFrame::ReparentFrameView(nsIFrame* aChildFrame,
// This code is called often and we need it to be as fast as possible, so
// see if we can trivially detect that no work needs to be done
aChildFrame->GetView(&childView);
aChildFrame->GetView(aPresContext, &childView);
if (!childView) {
// Child frame doesn't have a view. See if it has any child frames
nsIFrame* firstChild;
@ -218,8 +220,8 @@ nsHTMLContainerFrame::ReparentFrameView(nsIFrame* aChildFrame,
}
// See if either the old parent frame or the new parent frame have a view
aOldParentFrame->GetView(&oldParentView);
aNewParentFrame->GetView(&newParentView);
aOldParentFrame->GetView(aPresContext, &oldParentView);
aNewParentFrame->GetView(aPresContext, &newParentView);
if (!oldParentView && !newParentView) {
// Walk up both the old parent frame and the new parent frame nodes
@ -243,8 +245,8 @@ nsHTMLContainerFrame::ReparentFrameView(nsIFrame* aChildFrame,
}
// Get the views
aOldParentFrame->GetView(&oldParentView);
aNewParentFrame->GetView(&newParentView);
aOldParentFrame->GetView(aPresContext, &oldParentView);
aNewParentFrame->GetView(aPresContext, &newParentView);
} while (!(oldParentView || newParentView));
}
@ -262,10 +264,10 @@ nsHTMLContainerFrame::ReparentFrameView(nsIFrame* aChildFrame,
// common parent
NS_ASSERTION(oldParentView || newParentView, "internal error");
if (!oldParentView) {
oldParentView = GetClosestViewFor(aOldParentFrame);
oldParentView = GetClosestViewFor(aPresContext, aOldParentFrame);
}
if (!newParentView) {
newParentView = GetClosestViewFor(aNewParentFrame);
newParentView = GetClosestViewFor(aPresContext, aNewParentFrame);
}
// See if the old parent frame and the new parent frame are in the
@ -276,7 +278,7 @@ nsHTMLContainerFrame::ReparentFrameView(nsIFrame* aChildFrame,
oldParentView->GetViewManager(*getter_AddRefs(viewManager));
// They're not so we need to reparent any child views
return ReparentFrameViewTo(aChildFrame, viewManager, newParentView,
return ReparentFrameViewTo(aPresContext, aChildFrame, viewManager, newParentView,
oldParentView);
}
@ -290,7 +292,7 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext& aPresContext,
PRBool aForce)
{
nsIView* view;
aFrame->GetView(&view);
aFrame->GetView(&aPresContext, &view);
// If we don't yet have a view, see if we need a view
if (nsnull == view) {
PRInt32 zIndex = 0;
@ -361,11 +363,11 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext& aPresContext,
// Create a view
nsIFrame* parent;
aFrame->GetParentWithView(&parent);
aFrame->GetParentWithView(&aPresContext, &parent);
NS_ASSERTION(parent, "GetParentWithView failed");
nsIView* parentView;
parent->GetView(&parentView);
parent->GetView(&aPresContext, &parentView);
NS_ASSERTION(parentView, "no parent with view");
// Create a view
@ -470,7 +472,7 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext& aPresContext,
}
// Remember our view
aFrame->SetView(view);
aFrame->SetView(&aPresContext, view);
NS_FRAME_LOG(NS_FRAME_TRACE_CALLS,
("nsHTMLContainerFrame::CreateViewForFrame: frame=%p view=%p",

Просмотреть файл

@ -65,9 +65,10 @@ public:
nsIStyleContext* aStyleContext,
PRBool aForce);
static nsresult ReparentFrameView(nsIFrame* aChildFrame,
nsIFrame* aOldParentFrame,
nsIFrame* aNewParentFrame);
static nsresult ReparentFrameView(nsIPresContext* aPresContext,
nsIFrame* aChildFrame,
nsIFrame* aOldParentFrame,
nsIFrame* aNewParentFrame);
protected:
virtual PRIntn GetSkipSides() const = 0;

Просмотреть файл

@ -94,7 +94,7 @@ public:
#endif
// XXX Temporary hack...
NS_IMETHOD SetRect(const nsRect& aRect);
NS_IMETHOD SetRect(nsIPresContext* aPresContext, const nsRect& aRect);
protected:
virtual PRIntn GetSkipSides() const;
@ -124,9 +124,9 @@ NS_NewRootFrame(nsIFrame** aNewFrame)
// 'min-height', and 'max-height' properties. Then we can do this in a top-down
// fashion
NS_IMETHODIMP
RootFrame::SetRect(const nsRect& aRect)
RootFrame::SetRect(nsIPresContext* aPresContext, const nsRect& aRect)
{
nsresult rv = nsHTMLContainerFrame::SetRect(aRect);
nsresult rv = nsHTMLContainerFrame::SetRect(aPresContext, aRect);
// If our height is larger than our natural height (the height we returned
// as our desired height), then make sure the document element's frame is
@ -143,7 +143,7 @@ RootFrame::SetRect(const nsRect& aRect)
nsSize kidSize;
kidFrame->GetSize(kidSize);
kidFrame->SizeTo(kidSize.width, kidSize.height + yDelta);
kidFrame->SizeTo(aPresContext, kidSize.width, kidSize.height + yDelta);
}
}
@ -226,7 +226,7 @@ RootFrame::RemoveFrame(nsIPresContext& aPresContext,
// Damage the area occupied by the deleted frame
nsRect damageRect;
aOldFrame->GetRect(damageRect);
Invalidate(damageRect, PR_FALSE);
Invalidate(&aPresContext, damageRect, PR_FALSE);
// Remove the frame and destroy it
mFrames.DestroyFrame(aPresContext, aOldFrame);
@ -386,13 +386,13 @@ RootFrame::Reflow(nsIPresContext& aPresContext,
// Position and size the child frame
nsRect rect(kidReflowState.mComputedMargin.left, kidReflowState.mComputedMargin.top,
kidDesiredSize.width, kidDesiredSize.height);
kidFrame->SetRect(rect);
kidFrame->SetRect(&aPresContext, rect);
// If the child frame was just inserted, then we're responsible for making sure
// it repaints
if (isDirtyChildReflow) {
// Damage the area occupied by the deleted frame
Invalidate(rect, PR_FALSE);
Invalidate(&aPresContext, rect, PR_FALSE);
}
}

Просмотреть файл

@ -389,9 +389,14 @@ public:
NS_IMETHOD GetRect(nsRect& aRect) const = 0;
NS_IMETHOD GetOrigin(nsPoint& aPoint) const = 0;
NS_IMETHOD GetSize(nsSize& aSize) const = 0;
NS_IMETHOD SetRect(const nsRect& aRect) = 0;
NS_IMETHOD MoveTo(nscoord aX, nscoord aY) = 0;
NS_IMETHOD SizeTo(nscoord aWidth, nscoord aHeight) = 0;
NS_IMETHOD SetRect(nsIPresContext* aPresContext,
const nsRect& aRect) = 0;
NS_IMETHOD MoveTo(nsIPresContext* aPresContext,
nscoord aX,
nscoord aY) = 0;
NS_IMETHOD SizeTo(nsIPresContext* aPresContext,
nscoord aWidth,
nscoord aHeight) = 0;
/**
* Used to iterate the list of additional child list names. Returns the atom
@ -466,7 +471,8 @@ public:
nsPoint& aPoint,
PRInt32& aCursor) = 0;
NS_IMETHOD GetFrameForPoint(const nsPoint& aPoint,
NS_IMETHOD GetFrameForPoint(nsIPresContext* aPresContext,
const nsPoint& aPoint,
nsIFrame** aFrame) = 0;
@ -563,19 +569,24 @@ public:
/**
* Accessor functions to get/set the associated view object
*/
NS_IMETHOD GetView(nsIView** aView) const = 0; // may be null
NS_IMETHOD SetView(nsIView* aView) = 0;
NS_IMETHOD GetView(nsIPresContext* aPresContext,
nsIView** aView) const = 0; // may be null
NS_IMETHOD SetView(nsIPresContext* aPresContext,
nsIView* aView) = 0;
/**
* Find the first geometric parent that has a view
*/
NS_IMETHOD GetParentWithView(nsIFrame** aParent) const = 0;
NS_IMETHOD GetParentWithView(nsIPresContext* aPresContext,
nsIFrame** aParent) const = 0;
/**
* Returns the offset from this frame to the closest geometric parent that
* has a view. Also returns the containing view or null in case of error
*/
NS_IMETHOD GetOffsetFromView(nsPoint& aOffset, nsIView** aView) const = 0;
NS_IMETHOD GetOffsetFromView(nsIPresContext* aPresContext,
nsPoint& aOffset,
nsIView** aView) const = 0;
/**
* Returns the window that contains this frame. If this frame has a
@ -583,7 +594,8 @@ public:
* returned, otherwise this frame's geometric parent is checked
* recursively upwards.
*/
NS_IMETHOD GetWindow(nsIWidget**) const = 0;
NS_IMETHOD GetWindow(nsIPresContext* aPresContext,
nsIWidget** aWidget) const = 0;
/**
* Get the "type" of the frame. May return a NULL atom pointer
@ -604,7 +616,7 @@ public:
NS_IMETHOD Scrolled(nsIView *aView) = 0;
// Debugging
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const = 0;
NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const = 0;
/**
* Get a printable from of the name of the frame type.
@ -650,7 +662,10 @@ public:
* @param aSelected is it selected
* @param aSpread should is spread selection to flow elements around it? or go down to its children?
*/
NS_IMETHOD SetSelected(nsIDOMRange *aRange,PRBool aSelected, nsSpread aSpread) = 0;
NS_IMETHOD SetSelected(nsIPresContext* aPresContext,
nsIDOMRange* aRange,
PRBool aSelected,
nsSpread aSpread) = 0;
NS_IMETHOD GetSelected(PRBool *aSelected) const = 0;
@ -664,7 +679,7 @@ public:
* return NS_ERROR_FAILURE
* @param aPOS is defined in nsIFrameSelection
*/
NS_IMETHOD PeekOffset(nsPeekOffsetStruct *aPos) = 0;
NS_IMETHOD PeekOffset(nsIPresContext* aPresContext, nsPeekOffsetStruct *aPos) = 0;
/**
* See if tree verification is enabled. To enable tree verification add

Просмотреть файл

@ -3,6 +3,8 @@
#include "nsISupports.h"
class nsIPresContext;
#define NS_ISTATEFULFRAME_IID_STR "306c8ca0-5f0c-11d3-a9fb-000064657374"
#define NS_ISTATEFULFRAME_IID \
@ -18,9 +20,9 @@ class nsIStatefulFrame : public nsISupports {
enum StateType {eNoType=-1, eCheckboxType, eFileType, eRadioType, eSelectType,
eTextType, eNumStateTypes};
NS_IMETHOD GetStateType(nsIStatefulFrame::StateType* aStateType) = 0;
NS_IMETHOD SaveState(nsISupports** aState) = 0;
NS_IMETHOD RestoreState(nsISupports* aState) = 0;
NS_IMETHOD GetStateType(nsIPresContext* aPresContext, nsIStatefulFrame::StateType* aStateType) = 0;
NS_IMETHOD SaveState(nsIPresContext* aPresContext, nsISupports** aState) = 0;
NS_IMETHOD RestoreState(nsIPresContext* aPresContext, nsISupports* aState) = 0;
};

Просмотреть файл

@ -646,10 +646,10 @@ nsImageFrame::TranslateEventCoords(nsIPresContext& aPresContext,
// to this frame; otherwise we have to adjust the coordinates
// appropriately.
nsIView* view;
GetView(&view);
GetView(&aPresContext, &view);
if (nsnull == view) {
nsPoint offset;
GetOffsetFromView(offset, &view);
GetOffsetFromView(&aPresContext, offset, &view);
if (nsnull != view) {
x -= offset.x;
y -= offset.y;
@ -855,7 +855,7 @@ nsImageFrame::AttributeChanged(nsIPresContext* aPresContext,
if (loadStatus & NS_IMAGE_LOAD_STATUS_IMAGE_READY) {
// Trigger a paint now because image-loader won't if the
// image is already loaded and ready to go.
Invalidate(nsRect(0, 0, mRect.width, mRect.height), PR_FALSE);
Invalidate(aPresContext, nsRect(0, 0, mRect.width, mRect.height), PR_FALSE);
}
}
else {

Просмотреть файл

@ -1357,7 +1357,7 @@ nsInlineFrame::DrainOverflow(nsIPresContext* aPresContext)
// change InsertFrames() to do this, but that's a general purpose
// function and it doesn't seem like this functionality belongs there...
for (nsIFrame* f = prevOverflowFrames; f; f->GetNextSibling(&f)) {
nsHTMLContainerFrame::ReparentFrameView(f, prevInFlow, this);
nsHTMLContainerFrame::ReparentFrameView(aPresContext, f, prevInFlow, this);
}
mFrames.InsertFrames(this, nsnull, prevOverflowFrames);
}
@ -1637,7 +1637,7 @@ nsInlineFrame::PullInlineFrame(nsIPresContext* aPresContext,
frame = mFrames.PullFrame(this, irs.mPrevFrame, nextInFlow->mFrames);
if (nsnull != frame) {
isComplete = PR_FALSE;
nsHTMLContainerFrame::ReparentFrameView(frame, nextInFlow, this);
nsHTMLContainerFrame::ReparentFrameView(aPresContext, frame, nextInFlow, this);
break;
}
nextInFlow = (nsInlineFrame*) nextInFlow->mNextInFlow;
@ -1657,7 +1657,7 @@ nsInlineFrame::PullAnyFrame(nsIPresContext* aPresContext,
while (nsnull != nextInFlow) {
frame = mFrames.PullFrame(this, irs.mPrevFrame, nextInFlow->mFrames);
if (nsnull != frame) {
nsHTMLContainerFrame::ReparentFrameView(frame, nextInFlow, this);
nsHTMLContainerFrame::ReparentFrameView(aPresContext, frame, nextInFlow, this);
break;
}

Просмотреть файл

@ -135,7 +135,7 @@ nsLineBox::StateToString(char* aBuf, PRInt32 aBufSize) const
}
void
nsLineBox::List(FILE* out, PRInt32 aIndent) const
nsLineBox::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const
{
PRInt32 i;
@ -161,7 +161,7 @@ nsLineBox::List(FILE* out, PRInt32 aIndent) const
nsIFrame* frame = mFirstChild;
PRInt32 n = GetChildCount();
while (--n >= 0) {
frame->List(out, aIndent + 1);
frame->List(aPresContext, out, aIndent + 1);
frame->GetNextSibling(&frame);
}

Просмотреть файл

@ -254,7 +254,7 @@ public:
static nsLineBox* FindLineContaining(nsLineBox* aLine, nsIFrame* aFrame,
PRInt32* aFrameIndexInLine);
void List(FILE* out, PRInt32 aIndent) const;
void List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const;
nsIFrame* LastChild() const;

Просмотреть файл

@ -1517,7 +1517,7 @@ nsLineLayout::VerticalAlignFrames(nsRect& aLineBoxResult,
pfd->mBounds.y += baselineY;
break;
}
pfd->mFrame->SetRect(pfd->mBounds);
pfd->mFrame->SetRect(&mPresContext, pfd->mBounds);
#ifdef NOISY_VERTICAL_ALIGN
printf(" ");
nsFrame::ListTag(stdout, pfd->mFrame);
@ -1563,7 +1563,7 @@ nsLineLayout::PlaceTopBottomFrames(PerSpanData* psd,
else {
pfd->mBounds.y = -aDistanceFromTop + pfd->mMargin.top;
}
pfd->mFrame->SetRect(pfd->mBounds);
pfd->mFrame->SetRect(&mPresContext, pfd->mBounds);
#ifdef NOISY_VERTICAL_ALIGN
printf(" ");
nsFrame::ListTag(stdout, pfd->mFrame);
@ -1584,7 +1584,7 @@ nsLineLayout::PlaceTopBottomFrames(PerSpanData* psd,
pfd->mBounds.y = -aDistanceFromTop + aLineHeight -
pfd->mMargin.bottom - pfd->mBounds.height;
}
pfd->mFrame->SetRect(pfd->mBounds);
pfd->mFrame->SetRect(&mPresContext, pfd->mBounds);
#ifdef NOISY_VERTICAL_ALIGN
printf(" ");
nsFrame::ListTag(stdout, pfd->mFrame);
@ -1967,7 +1967,7 @@ nsLineLayout::VerticalAlignFrames(PerSpanData* psd)
#endif
}
if (psd != mRootSpan) {
frame->SetRect(pfd->mBounds);
frame->SetRect(&mPresContext, pfd->mBounds);
}
}
pfd = pfd->mNext;
@ -2078,7 +2078,7 @@ nsLineLayout::TrimTrailingWhiteSpaceIn(PerSpanData* psd,
nsIFrame* f = pfd->mFrame;
f->GetRect(r);
r.width -= deltaWidth;
f->SetRect(r);
f->SetRect(&mPresContext, r);
}
// Adjust the right edge of the span that contains the child span
@ -2130,7 +2130,7 @@ nsLineLayout::TrimTrailingWhiteSpaceIn(PerSpanData* psd,
if (psd != mRootSpan) {
// The frame was already placed during psd's
// reflow. Update the frames rectangle now.
pfd->mFrame->SetRect(pfd->mBounds);
pfd->mFrame->SetRect(&mPresContext, pfd->mBounds);
}
// Adjust containing span's right edge
@ -2227,7 +2227,7 @@ nsLineLayout::HorizontalAlignFrames(nsRect& aLineBounds, PRBool aAllowJustify)
PerFrameData* pfd = psd->mFirstFrame;
while (nsnull != pfd) {
pfd->mBounds.x += dx;
pfd->mFrame->SetRect(pfd->mBounds);
pfd->mFrame->SetRect(&mPresContext, pfd->mBounds);
pfd = pfd->mNext;
}
aLineBounds.width += dx;
@ -2242,7 +2242,7 @@ nsLineLayout::HorizontalAlignFrames(nsRect& aLineBounds, PRBool aAllowJustify)
PRUint32 maxX = psd->mRightEdge;
while (nsnull != pfd) {
pfd->mBounds.x = maxX - pfd->mBounds.width;
pfd->mFrame->SetRect(pfd->mBounds);
pfd->mFrame->SetRect(&mPresContext, pfd->mBounds);
maxX = pfd->mBounds.x;
pfd = pfd->mNext;
}
@ -2297,7 +2297,7 @@ nsLineLayout::RelativePositionFrames(PerSpanData* psd, nsRect& aCombinedArea)
// XXX what about right and bottom?
nscoord dx = pfd->mOffsets.left;
nscoord dy = pfd->mOffsets.top;
frame->MoveTo(origin.x + dx, origin.y + dy);
frame->MoveTo(&mPresContext, origin.x + dx, origin.y + dy);
x += dx;
y += dy;
}

Просмотреть файл

@ -206,7 +206,10 @@ public:
nsIContent* aChild,
nsISupports* aSubContent);
//local methods
nsresult CreateWidget(nscoord aWidth, nscoord aHeight, PRBool aViewOnly);
nsresult CreateWidget(nsIPresContext* aPresContext,
nscoord aWidth,
nscoord aHeight,
PRBool aViewOnly);
nsresult GetFullURL(nsIURI*& aFullURL);
nsresult GetPluginInstance(nsIPluginInstance*& aPluginInstance);
@ -406,7 +409,10 @@ nsObjectFrame::GetFrameName(nsString& aResult) const
}
nsresult
nsObjectFrame::CreateWidget(nscoord aWidth, nscoord aHeight, PRBool aViewOnly)
nsObjectFrame::CreateWidget(nsIPresContext* aPresContext,
nscoord aWidth,
nscoord aHeight,
PRBool aViewOnly)
{
nsIView* view;
@ -425,8 +431,8 @@ nsObjectFrame::CreateWidget(nscoord aWidth, nscoord aHeight, PRBool aViewOnly)
nsIFrame* parWithView;
nsIView *parView;
GetParentWithView(&parWithView);
parWithView->GetView(&parView);
GetParentWithView(aPresContext, &parWithView);
parWithView->GetView(aPresContext, &parView);
if (NS_OK == parView->GetViewManager(viewMan))
{
@ -474,12 +480,12 @@ nsObjectFrame::CreateWidget(nscoord aWidth, nscoord aHeight, PRBool aViewOnly)
nsIView* parentWithView;
nsPoint origin;
view->SetVisibility(nsViewVisibility_kShow);
GetOffsetFromView(origin, &parentWithView);
GetOffsetFromView(aPresContext, origin, &parentWithView);
viewMan->ResizeView(view, mRect.width, mRect.height);
viewMan->MoveViewTo(view, origin.x, origin.y);
}
SetView(view);
SetView(aPresContext, view);
exit:
NS_IF_RELEASE(viewMan);
@ -953,7 +959,7 @@ nsObjectFrame::InstantiateWidget(nsIPresContext& aPresContext,
GetDesiredSize(&aPresContext, aReflowState, aMetrics);
nsIView *parentWithView;
nsPoint origin;
GetOffsetFromView(origin, &parentWithView);
GetOffsetFromView(&aPresContext, origin, &parentWithView);
// Just make the frigging widget
float t2p;
@ -1004,7 +1010,7 @@ nsObjectFrame::InstantiatePlugin(nsIPresContext& aPresContext,
mInstanceOwner->GetWindow(window);
GetOffsetFromView(origin, &parentWithView);
GetOffsetFromView(&aPresContext, origin, &parentWithView);
window->x = NSTwipsToIntPixels(origin.x, t2p);
window->y = NSTwipsToIntPixels(origin.y, t2p);
window->width = NSTwipsToIntPixels(aMetrics.width, t2p);
@ -1044,7 +1050,7 @@ nsObjectFrame::ReinstantiatePlugin(nsIPresContext& aPresContext, nsHTMLReflowMet
mInstanceOwner->GetWindow(window);
GetOffsetFromView(origin, &parentWithView);
GetOffsetFromView(&aPresContext, origin, &parentWithView);
window->x = NSTwipsToIntPixels(origin.x, t2p);
window->y = NSTwipsToIntPixels(origin.y, t2p);
window->width = NSTwipsToIntPixels(aMetrics.width, t2p);
@ -1122,7 +1128,7 @@ nsObjectFrame::HandleImage(nsIPresContext& aPresContext,
ReflowChild(child, aPresContext, kidDesiredSize, kidReflowState, status);
nsRect rect(0, 0, kidDesiredSize.width, kidDesiredSize.height);
child->SetRect(rect);
child->SetRect(&aPresContext, rect);
aMetrics.width = kidDesiredSize.width;
aMetrics.height = kidDesiredSize.height;
@ -1187,7 +1193,7 @@ nsObjectFrame::DidReflow(nsIPresContext& aPresContext,
// positioned then we show it.
if (NS_FRAME_REFLOW_FINISHED == aStatus) {
nsIView* view = nsnull;
GetView(&view);
GetView(&aPresContext, &view);
if (nsnull != view) {
view->SetVisibility(nsViewVisibility_kShow);
}
@ -1203,7 +1209,7 @@ nsObjectFrame::DidReflow(nsIPresContext& aPresContext,
aPresContext.GetTwipsToPixels(&t2p);
nscoord offx, offy;
GetOffsetFromView(origin, &parentWithView);
GetOffsetFromView(&aPresContext, origin, &parentWithView);
#if 0
// beard: how do we get this?
@ -1759,7 +1765,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetURL(const char *aURL, const char *aTarge
if ((nsnull != mOwner) && (nsnull != mContext))
{
rv = mOwner->GetOffsetFromView(origin, &view);
rv = mOwner->GetOffsetFromView(mContext, origin, &view);
if (NS_OK == rv)
{
@ -2433,7 +2439,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::CreateWidget(void)
{
// Create view if necessary
mOwner->GetView(&view);
mOwner->GetView(mContext, &view);
if (nsnull == view)
{
@ -2441,12 +2447,13 @@ NS_IMETHODIMP nsPluginInstanceOwner::CreateWidget(void)
mInstance->GetValue(nsPluginInstanceVariable_WindowlessBool, (void *)&windowless);
rv = mOwner->CreateWidget(mPluginWindow.width,
rv = mOwner->CreateWidget(mContext,
mPluginWindow.width,
mPluginWindow.height,
windowless);
if (NS_OK == rv)
{
mOwner->GetView(&view);
mOwner->GetView(mContext, &view);
view->GetWidget(mWidget);
if (PR_TRUE == windowless)

Просмотреть файл

@ -85,7 +85,7 @@ NS_METHOD nsPageFrame::Reflow(nsIPresContext& aPresContext,
}
nsRect rect(0, 0, aDesiredSize.width, aDesiredSize.height);
mFrames.FirstChild()->SetRect(rect);
mFrames.FirstChild()->SetRect(&aPresContext, rect);
} else {
// Do we have any children?
@ -129,7 +129,7 @@ NS_METHOD nsPageFrame::Reflow(nsIPresContext& aPresContext,
// Place and size the child
nsRect rect(0, 0, aDesiredSize.width, aDesiredSize.height);
frame->SetRect(rect);
frame->SetRect(&aPresContext, rect);
// XXX Should we be sending the DidReflow?
htmlReflow->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED);

Просмотреть файл

@ -95,12 +95,12 @@ nsPlaceholderFrame::GetFrameName(nsString& aResult) const
}
NS_IMETHODIMP
nsPlaceholderFrame::List(FILE* out, PRInt32 aIndent) const
nsPlaceholderFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const
{
IndentBy(out, aIndent);
ListTag(out);
nsIView* view;
GetView(&view);
GetView(aPresContext, &view);
if (nsnull != view) {
fprintf(out, " [view=%p]", view);
}

Просмотреть файл

@ -46,7 +46,7 @@ public:
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer);
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const;
NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const;
/**
* Get the "type" of the frame

Просмотреть файл

@ -127,7 +127,7 @@ nsSimplePageSequenceFrame::IncrementalReflow(nsIPresContext& aPresConte
// Place and size the page. If the page is narrower than our max width, then
// center it horizontally
nsRect rect(aX, aY, kidSize.width, kidSize.height);
nextFrame->SetRect(rect);
nextFrame->SetRect(&aPresContext, rect);
aY += kidSize.height + PAGE_SPACING_TWIPS;
// Check if the page is complete...
@ -166,7 +166,7 @@ nsSimplePageSequenceFrame::IncrementalReflow(nsIPresContext& aPresConte
// max width then center it horizontally
ReflowChild(kidFrame, aPresContext, childSize, childReflowState,
status);
kidFrame->SetRect(nsRect(aX, aY, childSize.width, childSize.height));
kidFrame->SetRect(&aPresContext, nsRect(aX, aY, childSize.width, childSize.height));
aY += childSize.height;
// Leave a slight gap between the pages
@ -239,7 +239,7 @@ nsSimplePageSequenceFrame::Reflow(nsIPresContext& aPresContext,
// Place and size the page. If the page is narrower than our
// max width then center it horizontally
ReflowChild(kidFrame, aPresContext, kidSize, kidReflowState, status);
kidFrame->SetRect(nsRect(x, y, kidSize.width, kidSize.height));
kidFrame->SetRect(&aPresContext, nsRect(x, y, kidSize.width, kidSize.height));
y += kidSize.height;
// Leave a slight gap between the pages
@ -419,7 +419,7 @@ nsSimplePageSequenceFrame::Print(nsIPresContext& aPresContext,
// Print the page
nsIView* view;
page->GetView(&view);
page->GetView(&aPresContext, &view);
NS_ASSERTION(nsnull != view, "no page view");
vm->Display(view);

Просмотреть файл

@ -144,7 +144,7 @@ public:
NS_DECL_ISUPPORTS
void AddFrame(nsIFrame* aFrame);
void AddFrame(nsIPresContext* aPresContext, nsIFrame* aFrame);
PRBool RemoveFrame(nsIFrame* aFrame);
@ -156,8 +156,19 @@ public:
virtual void Notify(nsITimer *timer);
struct FrameData {
nsIPresContext* mPresContext; // pres context associated with the frame
nsIFrame* mFrame;
FrameData(nsIPresContext* aPresContext,
nsIFrame* aFrame)
: mPresContext(aPresContext), mFrame(aFrame) {}
};
nsITimer* mTimer;
nsVoidArray mFrames;
nsIPresContext* mPresContext;
};
static PRBool gBlinkTextOff;
@ -196,15 +207,27 @@ void nsBlinkTimer::Stop()
static NS_DEFINE_IID(kITimerCallbackIID, NS_ITIMERCALLBACK_IID);
NS_IMPL_ISUPPORTS(nsBlinkTimer, kITimerCallbackIID);
void nsBlinkTimer::AddFrame(nsIFrame* aFrame) {
mFrames.AppendElement(aFrame);
void nsBlinkTimer::AddFrame(nsIPresContext* aPresContext, nsIFrame* aFrame) {
FrameData* frameData = new FrameData(aPresContext, aFrame);
mFrames.AppendElement(frameData);
if (1 == mFrames.Count()) {
Start();
}
}
PRBool nsBlinkTimer::RemoveFrame(nsIFrame* aFrame) {
PRBool rv = mFrames.RemoveElement(aFrame);
PRInt32 i, n = mFrames.Count();
PRBool rv = PR_FALSE;
for (i = 0; i < n; i++) {
FrameData* frameData = (FrameData*) mFrames.ElementAt(i);
if (frameData->mFrame == aFrame) {
rv = mFrames.RemoveElementAt(i);
delete frameData;
break;
}
}
if (0 == mFrames.Count()) {
Stop();
}
@ -239,14 +262,14 @@ void nsBlinkTimer::Notify(nsITimer *timer)
PRInt32 i, n = mFrames.Count();
for (i = 0; i < n; i++) {
nsIFrame* text = (nsIFrame*) mFrames.ElementAt(i);
FrameData* frameData = (FrameData*) mFrames.ElementAt(i);
// Determine damaged area and tell view manager to redraw it
nsPoint offset;
nsRect bounds;
text->GetRect(bounds);
frameData->mFrame->GetRect(bounds);
nsIView* view;
text->GetOffsetFromView(offset, &view);
frameData->mFrame->GetOffsetFromView(frameData->mPresContext, offset, &view);
nsIViewManager* vm;
view->GetViewManager(vm);
bounds.x = offset.x;
@ -290,7 +313,7 @@ public:
return NS_OK;
}
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const;
NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const;
/**
* Get the "type" of the frame
@ -325,9 +348,12 @@ public:
PRInt32& aOffset);
NS_IMETHOD SetSelected(nsIDOMRange *aRange,PRBool aSelected, nsSpread aSpread);
NS_IMETHOD SetSelected(nsIPresContext* aPresContext,
nsIDOMRange *aRange,
PRBool aSelected,
nsSpread aSpread);
NS_IMETHOD PeekOffset(nsPeekOffsetStruct *aPos);
NS_IMETHOD PeekOffset(nsIPresContext* aPresContext, nsPeekOffsetStruct *aPos);
NS_IMETHOD HandleMultiplePress(nsIPresContext& aPresContext,
nsGUIEvent * aEvent,
@ -1281,8 +1307,8 @@ nsTextFrame::GetPositionSlowly(nsIPresContext& aPresContext,
}
nsIView * view;
nsPoint origin;
GetView(&view);
GetOffsetFromView(origin, &view);
GetView(&aPresContext, &view);
GetOffsetFromView(&aPresContext, origin, &view);
if (aXCoord - origin.x <0)
{
@ -1912,7 +1938,7 @@ nsTextFrame::GetPosition(nsIPresContext& aCX,
PRUnichar* text = paintBuffer.mBuffer;
nsPoint origin;
nsIView * view;
GetOffsetFromView(origin, &view);
GetOffsetFromView(&aCX, origin, &view);
PRBool found = BinarySearchForPosition(acx, text, origin.x, 0, 0,
PRInt32(textLength),
PRInt32(aXCoord) , //go to local coordinates
@ -1970,7 +1996,10 @@ void ForceDrawFrame(nsFrame * aFrame);
//null range means the whole thing
NS_IMETHODIMP
nsTextFrame::SetSelected(nsIDOMRange *aRange,PRBool aSelected, nsSpread aSpread)
nsTextFrame::SetSelected(nsIPresContext* aPresContext,
nsIDOMRange *aRange,
PRBool aSelected,
nsSpread aSpread)
{
nsresult result;
if (aSelected && ParentDisablesSelection())
@ -2046,7 +2075,7 @@ nsTextFrame::SetSelected(nsIDOMRange *aRange,PRBool aSelected, nsSpread aSpread)
nsRect frameRect;
GetRect(frameRect);
nsRect rect(0, 0, frameRect.width, frameRect.height);
Invalidate(rect, PR_FALSE);
Invalidate(aPresContext, rect, PR_FALSE);
// ForceDrawFrame(this);
}
if (aSpread == eSpreadDown)
@ -2054,14 +2083,14 @@ nsTextFrame::SetSelected(nsIDOMRange *aRange,PRBool aSelected, nsSpread aSpread)
nsIFrame *frame;
GetPrevInFlow(&frame);
while(frame){
frame->SetSelected(aRange,aSelected,eSpreadNone);
frame->SetSelected(aPresContext, aRange,aSelected,eSpreadNone);
result = frame->GetPrevInFlow(&frame);
if (NS_FAILED(result))
break;
}
GetNextInFlow(&frame);
while (frame){
frame->SetSelected(aRange,aSelected,eSpreadNone);
frame->SetSelected(aPresContext, aRange,aSelected,eSpreadNone);
result = frame->GetNextInFlow(&frame);
if (NS_FAILED(result))
break;
@ -2181,7 +2210,7 @@ nsTextFrame::GetChildFrameContainingOffset(PRInt32 inContentOffset,
NS_IMETHODIMP
nsTextFrame::PeekOffset(nsPeekOffsetStruct *aPos)
nsTextFrame::PeekOffset(nsIPresContext* aPresContext, nsPeekOffsetStruct *aPos)
{
if (!aPos || !mContent)
@ -2198,13 +2227,13 @@ nsTextFrame::PeekOffset(nsPeekOffsetStruct *aPos)
NS_ASSERTION(PR_FALSE,"nsTextFrame::PeekOffset no more flow \n");
return NS_ERROR_INVALID_ARG;
}
return nextInFlow->PeekOffset(aPos);
return nextInFlow->PeekOffset(aPresContext, aPos);
}
if (aPos->mAmount == eSelectLine || aPos->mAmount == eSelectBeginLine
|| aPos->mAmount == eSelectEndLine)
{
return nsFrame::PeekOffset(aPos);
return nsFrame::PeekOffset(aPresContext, aPos);
}
nsAutoTextBuffer paintBuffer;
@ -2242,7 +2271,7 @@ nsTextFrame::PeekOffset(nsPeekOffsetStruct *aPos)
else
{
aPos->mAmount = eSelectDir;//go to "next" or previous frame based on direction not THIS frame
return nsFrame::PeekOffset(aPos);//no matter what this is not a valid frame to end up on
return nsFrame::PeekOffset(aPresContext, aPos);//no matter what this is not a valid frame to end up on
}
}
break;
@ -2305,7 +2334,7 @@ nsTextFrame::PeekOffset(nsPeekOffsetStruct *aPos)
{
result = GetFrameFromDirection(aPos);
if (NS_SUCCEEDED(result) && aPos->mResultFrame && aPos->mResultFrame!= this)
result = aPos->mResultFrame->PeekOffset(aPos);
result = aPos->mResultFrame->PeekOffset(aPresContext, aPos);
}
else
aPos->mResultContent = mContent;
@ -2425,7 +2454,7 @@ nsTextFrame::PeekOffset(nsPeekOffsetStruct *aPos)
result = GetFrameFromDirection(aPos);
if (NS_SUCCEEDED(result) && aPos->mResultFrame && aPos->mResultFrame!= this)
{
if (NS_SUCCEEDED(result = aPos->mResultFrame->PeekOffset(aPos)))
if (NS_SUCCEEDED(result = aPos->mResultFrame->PeekOffset(aPresContext, aPos)))
return NS_OK;//else fall through
}
else
@ -2569,7 +2598,7 @@ nsTextFrame::HandleMultiplePress(nsIPresContext& aPresContext,
PR_FALSE,
PR_TRUE,
PR_FALSE);
rv = PeekOffset(&startpos);
rv = PeekOffset(&aPresContext, &startpos);
if (NS_FAILED(rv))
return rv;
nsPeekOffsetStruct endpos;
@ -2581,7 +2610,7 @@ nsTextFrame::HandleMultiplePress(nsIPresContext& aPresContext,
PR_FALSE,
PR_FALSE,
PR_FALSE);
rv = PeekOffset(&endpos);
rv = PeekOffset(&aPresContext, &endpos);
if (NS_FAILED(rv))
return rv;
@ -2673,7 +2702,7 @@ nsTextFrame::Reflow(nsIPresContext& aPresContext,
if (ts.mFont->mFont.decorations & NS_STYLE_TEXT_DECORATION_BLINK) {
if (0 == (mState & TEXT_BLINK_ON)) {
mState |= TEXT_BLINK_ON;
gTextBlinker->AddFrame(this);
gTextBlinker->AddFrame(&aPresContext, this);
}
}
else {
@ -3049,7 +3078,7 @@ nsTextFrame::Reflow(nsIPresContext& aPresContext,
// XXX We need a finer granularity than this, but it isn't clear what
// has actually changed...
if (eReflowReason_Incremental == aReflowState.reason) {
Invalidate(mRect);
Invalidate(&aPresContext, mRect);
}
nsReflowStatus rs = (offset == contentLength)
@ -3372,13 +3401,13 @@ nsTextFrame::GetFrameName(nsString& aResult) const
}
NS_IMETHODIMP
nsTextFrame::List(FILE* out, PRInt32 aIndent) const
nsTextFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const
{
// Output the tag
IndentBy(out, aIndent);
ListTag(out);
nsIView* view;
GetView(&view);
GetView(aPresContext, &view);
if (nsnull != view) {
fprintf(out, " [view=%p]", view);
}

Просмотреть файл

@ -292,7 +292,7 @@ ViewportFrame::CalculateFixedContainingBlockSize(nsIPresContext& aPresC
nsIFrame* kidFrame = mFrames.FirstChild();
nsIView* kidView;
kidFrame->GetView(&kidView);
kidFrame->GetView(&aPresContext, &kidView);
if (nsnull != kidView) {
nsIScrollableView* scrollingView;
@ -359,7 +359,7 @@ ViewportFrame::ReflowFixedFrame(nsIPresContext& aPresContext,
nsRect rect(kidReflowState.mComputedOffsets.left + kidReflowState.mComputedMargin.left,
kidReflowState.mComputedOffsets.top + kidReflowState.mComputedMargin.top,
kidDesiredSize.width, kidDesiredSize.height);
aKidFrame->SetRect(rect);
aKidFrame->SetRect(&aPresContext, rect);
htmlReflow->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED);
}
@ -514,7 +514,7 @@ ViewportFrame::Reflow(nsIPresContext& aPresContext,
aStatus);
nsRect rect(0, 0, kidDesiredSize.width, kidDesiredSize.height);
kidFrame->SetRect(rect);
kidFrame->SetRect(&aPresContext, rect);
kidRect = rect;
// XXX We should resolve the details of who/when DidReflow()
@ -554,7 +554,7 @@ ViewportFrame::Reflow(nsIPresContext& aPresContext,
if ((eReflowReason_Initial == aReflowState.reason) ||
(eReflowReason_Resize == aReflowState.reason)) {
nsRect damageRect(0, 0, aDesiredSize.width, aDesiredSize.height);
Invalidate(damageRect, PR_FALSE);
Invalidate(&aPresContext, damageRect, PR_FALSE);
}
NS_FRAME_TRACE_REFLOW_OUT("ViewportFrame::Reflow", aStatus);

Просмотреть файл

@ -365,7 +365,7 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegat
nsRect rect(border.left + kidReflowState.mComputedOffsets.left + kidReflowState.mComputedMargin.left,
border.top + kidReflowState.mComputedOffsets.top + kidReflowState.mComputedMargin.top,
kidDesiredSize.width, kidDesiredSize.height);
aKidFrame->SetRect(rect);
aKidFrame->SetRect(&aPresContext, rect);
}
return rv;

Просмотреть файл

@ -339,7 +339,7 @@ nsAreaFrame::DidReflow(nsIPresContext& aPresContext,
const nsStyleDisplay* display = (const nsStyleDisplay*)
mStyleContext->GetStyleData(eStyleStruct_Display);
GetView(&view);
GetView(&aPresContext, &view);
if (view && (NS_STYLE_OVERFLOW_VISIBLE == display->mOverflow)) {
// Don't let our base class position the view since we're doing it
mState &= ~NS_FRAME_SYNC_FRAME_AND_VIEW;
@ -357,7 +357,7 @@ nsAreaFrame::DidReflow(nsIPresContext& aPresContext,
// XXX We need to handle the case where child frames stick out on the
// left and top edges as well...
GetOffsetFromView(origin, &parentWithView);
GetOffsetFromView(&aPresContext, origin, &parentWithView);
vm->ResizeView(view, mCombinedArea.XMost(), mCombinedArea.YMost());
vm->MoveViewTo(view, origin.x, origin.y);
NS_RELEASE(vm);

Просмотреть файл

@ -1016,7 +1016,7 @@ nsBlockReflowState::RecoverStateFrom(nsLineBox* aLine,
fc->mCombinedArea.y += finalDeltaY;
nsIFrame* floater = fc->mPlaceholder->GetOutOfFlowFrame();
floater->GetRect(r);
floater->MoveTo(r.x, r.y + finalDeltaY);
floater->MoveTo(mPresContext, r.x, r.y + finalDeltaY);
#ifdef DEBUG
if (gNoisyReflow || gNoisySpaceManager) {
nscoord tx, ty;
@ -1161,12 +1161,12 @@ ListTextRuns(FILE* out, PRInt32 aIndent, nsTextRun* aRuns)
}
NS_METHOD
nsBlockFrame::List(FILE* out, PRInt32 aIndent) const
nsBlockFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const
{
IndentBy(out, aIndent);
ListTag(out);
nsIView* view;
GetView(&view);
GetView(aPresContext, &view);
if (nsnull != view) {
fprintf(out, " [view=%p]", view);
}
@ -1211,7 +1211,7 @@ nsBlockFrame::List(FILE* out, PRInt32 aIndent) const
if (nsnull != mLines) {
nsLineBox* line = mLines;
while (nsnull != line) {
line->List(out, aIndent);
line->List(aPresContext, out, aIndent);
line = line->mNext;
}
}
@ -1234,7 +1234,7 @@ nsBlockFrame::List(FILE* out, PRInt32 aIndent) const
}
fputs("<\n", out);
while (nsnull != kid) {
kid->List(out, aIndent + 1);
kid->List(aPresContext, out, aIndent + 1);
kid->GetNextSibling(&kid);
}
IndentBy(out, aIndent);
@ -1416,7 +1416,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext,
ListTag(stdout);
printf(": reflow=initial\n");
#endif
DrainOverflowLines();
DrainOverflowLines(&aPresContext);
rv = PrepareInitialReflow(state);
mState &= ~NS_FRAME_FIRST_REFLOW;
break;
@ -1467,7 +1467,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext,
ListTag(stdout);
printf(": reflow=resize (%d)\n", aReflowState.reason);
#endif
DrainOverflowLines();
DrainOverflowLines(&aPresContext);
rv = PrepareResizeReflow(state);
break;
}
@ -1534,7 +1534,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext,
if (isStyleChange) {
// Lots of things could have changed so damage our entire
// bounds
Invalidate(nsRect(0, 0, mRect.width, mRect.height));
Invalidate(&aPresContext, nsRect(0, 0, mRect.width, mRect.height));
} else {
nsMargin border = aReflowState.mComputedBorderPadding -
@ -1560,7 +1560,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext,
damageRect.y = 0;
damageRect.height = mRect.height;
}
Invalidate(damageRect);
Invalidate(&aPresContext, damageRect);
}
// See if our height changed
@ -1583,7 +1583,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext,
damageRect.y = mRect.height - border.bottom;
damageRect.height = border.bottom;
}
Invalidate(damageRect);
Invalidate(&aPresContext, damageRect);
}
}
}
@ -2429,7 +2429,7 @@ nsBlockFrame::ReflowDirtyLines(nsBlockReflowState& aState)
RecoverStateFrom(aState, line, deltaY, incrementalReflow ?
&damageRect : 0);
if (incrementalReflow && !damageRect.IsEmpty()) {
Invalidate(damageRect);
Invalidate(aState.mPresContext, damageRect);
}
}
@ -2482,7 +2482,7 @@ nsBlockFrame::ReflowDirtyLines(nsBlockReflowState& aState)
frame->SetParent(this);
// When pushing and pulling frames we need to check for whether any
// views need to be reparented
nsHTMLContainerFrame::ReparentFrameView(frame, mNextInFlow, this);
nsHTMLContainerFrame::ReparentFrameView(aState.mPresContext, frame, mNextInFlow, this);
lastFrame = frame;
frame->GetNextSibling(&frame);
}
@ -2602,7 +2602,7 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState,
// XXX We need to improve on this...
nsRect dirtyRect;
dirtyRect.UnionRect(oldCombinedArea, lineCombinedArea);
Invalidate(dirtyRect);
Invalidate(aState.mPresContext, dirtyRect);
} else {
if (oldCombinedArea.width != lineCombinedArea.width) {
@ -2618,7 +2618,7 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState,
dirtyRect.x;
dirtyRect.height = PR_MAX(oldCombinedArea.height,
lineCombinedArea.height);
Invalidate(dirtyRect);
Invalidate(aState.mPresContext, dirtyRect);
}
if (oldCombinedArea.height != lineCombinedArea.height) {
nsRect dirtyRect;
@ -2633,7 +2633,7 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState,
dirtyRect.height = PR_MAX(oldCombinedArea.YMost(),
lineCombinedArea.YMost()) -
dirtyRect.y;
Invalidate(dirtyRect);
Invalidate(aState.mPresContext, dirtyRect);
}
}
}
@ -2649,7 +2649,7 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState,
nsRect dirtyRect;
dirtyRect.UnionRect(oldCombinedArea, combinedArea);
Invalidate(dirtyRect);
Invalidate(aState.mPresContext, dirtyRect);
}
}
@ -2758,7 +2758,7 @@ nsBlockFrame::PullFrame(nsBlockReflowState& aState,
// When pushing and pulling frames we need to check for whether any
// views need to be reparented
NS_ASSERTION(oldParentFrame != this, "unexpected parent frame");
nsHTMLContainerFrame::ReparentFrameView(frame, oldParentFrame, this);
nsHTMLContainerFrame::ReparentFrameView(aState.mPresContext, frame, oldParentFrame, this);
// The frame is being pulled from a next-in-flow; therefore we
// need to add it to our sibling list.
@ -2796,7 +2796,7 @@ nsBlockFrame::SlideLine(nsBlockReflowState& aState,
kid->GetRect(r);
if (aDY) {
r.y += aDY;
kid->SetRect(r);
kid->SetRect(aState.mPresContext, r);
}
// If the child has any floaters that impact the space-manager,
@ -2827,7 +2827,7 @@ nsBlockFrame::SlideLine(nsBlockReflowState& aState,
while (--n >= 0) {
kid->GetRect(r);
r.y += aDY;
kid->SetRect(r);
kid->SetRect(aState.mPresContext, r);
kid->GetNextSibling(&kid);
}
}
@ -3361,7 +3361,7 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState,
nscoord bulletTopMargin = applyTopMargin ? collapsedBottomMargin : 0;
bbox.y = aState.BorderPadding().top + ascent -
metrics.ascent + bulletTopMargin;
mBullet->SetRect(bbox);
mBullet->SetRect(aState.mPresContext, bbox);
}
}
else {
@ -4160,7 +4160,7 @@ nsBlockFrame::PushLines(nsBlockReflowState& aState)
}
PRBool
nsBlockFrame::DrainOverflowLines()
nsBlockFrame::DrainOverflowLines(nsIPresContext* aPresContext)
{
#ifdef DEBUG
VerifyOverflowSituation();
@ -4183,7 +4183,7 @@ nsBlockFrame::DrainOverflowLines()
// When pushing and pulling frames we need to check for whether any
// views need to be reparented
nsHTMLContainerFrame::ReparentFrameView(frame, prevBlock, this);
nsHTMLContainerFrame::ReparentFrameView(aPresContext, frame, prevBlock, this);
// Get the next frame
lastFrame = frame;
@ -4721,7 +4721,7 @@ nsBlockFrame::FixParentAndView(nsIPresContext* aPresContext, nsIFrame* aFrame)
aFrame->GetParent(&oldParent);
aFrame->SetParent(this);
if (this != oldParent) {
nsHTMLContainerFrame::ReparentFrameView(aFrame, oldParent, this);
nsHTMLContainerFrame::ReparentFrameView(aPresContext, aFrame, oldParent, this);
aPresContext->ReParentStyleContext(aFrame, mStyleContext);
}
aFrame->GetNextSibling(&aFrame);
@ -4902,7 +4902,7 @@ nsBlockFrame::DoRemoveFrame(nsIPresContext* aPresContext,
// cases...
nsRect lineCombinedArea;
line->GetCombinedArea(&lineCombinedArea);
Invalidate(lineCombinedArea);
Invalidate(aPresContext, lineCombinedArea);
delete line;
line = next;
}
@ -5063,7 +5063,7 @@ nsBlockFrame::ReflowFloater(nsBlockReflowState& aState,
const nsHTMLReflowMetrics& metrics = brc.GetMetrics();
aCombinedRect = metrics.mCombinedArea;
floater->SizeTo(metrics.width, metrics.height);
floater->SizeTo(aState.mPresContext, metrics.width, metrics.height);
// Stash away the max-element-size for later
aState.StoreMaxElementSize(floater, brc.GetMaxElementSize());
@ -5402,7 +5402,7 @@ nsBlockReflowState::PlaceFloater(nsFloaterCache* aFloaterCache,
x += aFloaterCache->mOffsets.left;
y += aFloaterCache->mOffsets.top;
}
floater->MoveTo(x, y);
floater->MoveTo(mPresContext, x, y);
// Update the floater combined area state
nsRect combinedArea = aFloaterCache->mCombinedArea;
@ -5818,7 +5818,7 @@ nsBlockFrame::HandleEvent(nsIPresContext& aPresContext,
while(NS_SUCCEEDED(result))
{ //we are starting aloop to allow us to "drill down to the one we want"
mainframe->GetOffsetFromView(origin, &parentWithView);
mainframe->GetOffsetFromView(&aPresContext, origin, &parentWithView);
if (NS_FAILED(result))
return NS_OK;//do not handle
@ -5865,7 +5865,8 @@ nsBlockFrame::HandleEvent(nsIPresContext& aPresContext,
pos.mDirection = eDirNext;
pos.mDesiredX = aEvent->point.x;
result = nsFrame::GetNextPrevLineFromeBlockFrame(&pos,
result = nsFrame::GetNextPrevLineFromeBlockFrame(&aPresContext,
&pos,
mainframe,
closestLine-1,
0
@ -5893,20 +5894,22 @@ nsBlockFrame::HandleEvent(nsIPresContext& aPresContext,
NS_IMETHODIMP
nsBlockFrame::GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame)
nsBlockFrame::GetFrameForPoint(nsIPresContext* aPresContext,
const nsPoint& aPoint,
nsIFrame** aFrame)
{
nsresult rv = GetFrameForPointUsing(aPoint, nsnull, aFrame);
nsresult rv = GetFrameForPointUsing(aPresContext, aPoint, nsnull, aFrame);
if (NS_OK == rv) {
return NS_OK;
}
if (nsnull != mBullet) {
rv = GetFrameForPointUsing(aPoint, nsLayoutAtoms::bulletList, aFrame);
rv = GetFrameForPointUsing(aPresContext, aPoint, nsLayoutAtoms::bulletList, aFrame);
if (NS_OK == rv) {
return NS_OK;
}
}
if (mFloaters.NotEmpty()) {
rv = GetFrameForPointUsing(aPoint, nsLayoutAtoms::floaterList, aFrame);
rv = GetFrameForPointUsing(aPresContext, aPoint, nsLayoutAtoms::floaterList, aFrame);
if (NS_OK == rv) {
return NS_OK;
}
@ -6339,7 +6342,7 @@ nsBlockFrame::ReflowBullet(nsBlockReflowState& aState,
// the final vertical location.
const nsMargin& bp = aState.BorderPadding();
nscoord y = bp.top;
mBullet->SetRect(nsRect(x, y, aMetrics.width, aMetrics.height));
mBullet->SetRect(aState.mPresContext, nsRect(x, y, aMetrics.width, aMetrics.height));
}
//XXX get rid of this -- its slow

Просмотреть файл

@ -93,14 +93,14 @@ public:
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer);
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const;
NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
#endif
NS_IMETHOD VerifyTree() const;
NS_IMETHOD GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame);
NS_IMETHOD GetFrameForPoint(nsIPresContext* aPresContext, const nsPoint& aPoint, nsIFrame** aFrame);
NS_IMETHOD HandleEvent(nsIPresContext& aPresContext,
nsGUIEvent* aEvent,
nsEventStatus& aEventStatus);
@ -161,7 +161,7 @@ protected:
void SlideLine(nsBlockReflowState& aState,
nsLineBox* aLine, nscoord aDY);
PRBool DrainOverflowLines();
PRBool DrainOverflowLines(nsIPresContext* aPresContext);
virtual PRIntn GetSkipSides() const;

Просмотреть файл

@ -419,7 +419,7 @@ nsBlockReflowContext::PlaceBlock(PRBool aForceFit,
// Empty blocks do not have anything special done to them and they
// always fit. Note: don't force the width to 0
nsRect r(x, y, mMetrics.width, 0);
mFrame->SetRect(r);
mFrame->SetRect(mPresContext, r);
aInFlowBounds = r;
// Retain combined area information in case we contain a floater
@ -547,7 +547,7 @@ nsBlockReflowContext::PlaceBlock(PRBool aForceFit,
aCombinedRect.height = mMetrics.mCombinedArea.height;
// Now place the frame
mFrame->SetRect(nsRect(x, y, mMetrics.width, mMetrics.height));
mFrame->SetRect(mPresContext, nsRect(x, y, mMetrics.width, mMetrics.height));
// XXX obsolete, i believe...
#if 0

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше