mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-04-02 12:32:55 +00:00
Remove nsScrollFrame and frame constructor support for it. Remove dlldeps.cpp for layout, it's not necessary. Bug 201457, r+sr=roc.
This commit is contained in:
parent
213bfb9b9e
commit
d36a919a95
@ -1363,10 +1363,8 @@ nsCSSFrameConstructor::Init(nsIDocument* aDocument)
|
||||
// This initializes the Prefs booleans
|
||||
mGotGfxPrefs = PR_FALSE;
|
||||
mGotXBLFormPrefs = PR_FALSE;
|
||||
mHasGfxScrollbars = PR_FALSE;
|
||||
mUseXBLForms = PR_FALSE;
|
||||
|
||||
HasGfxScrollbars();
|
||||
UseXBLForms();
|
||||
|
||||
return NS_OK;
|
||||
@ -3329,17 +3327,6 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresShell* aPresShell,
|
||||
|
||||
|
||||
|
||||
---------------Native Scrollbars------
|
||||
|
||||
|
||||
|
||||
ScrollFrame
|
||||
|
||||
^
|
||||
|
|
||||
AreaFrame or BoxFrame (InitialContainingBlock)
|
||||
|
||||
|
||||
---------------Gfx Scrollbars ------
|
||||
|
||||
|
||||
@ -3596,21 +3583,6 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell,
|
||||
|
||||
|
||||
|
||||
---------------Native Scrollbars------
|
||||
|
||||
|
||||
|
||||
ViewPortFrame (FixedContainingBlock) <---- RootView
|
||||
|
||||
^
|
||||
|
|
||||
ScrollFrame <--- RootScrollableView
|
||||
|
||||
^
|
||||
|
|
||||
RootFrame(DocElementContainingBlock)
|
||||
|
||||
|
||||
---------------Gfx Scrollbars ------
|
||||
|
||||
|
||||
@ -3897,11 +3869,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell,
|
||||
viewManager->SetRootScrollableView(scrollableView);
|
||||
parentFrame = newScrollableFrame;
|
||||
|
||||
// if gfx scrollbars store them
|
||||
if (HasGfxScrollbars())
|
||||
mGfxScrollFrame = newFrame;
|
||||
else
|
||||
mGfxScrollFrame = nsnull;
|
||||
mGfxScrollFrame = newFrame;
|
||||
|
||||
} else {
|
||||
// If no scrollbars and xul, don't build a scrollframe at all.
|
||||
@ -4228,12 +4196,6 @@ nsCSSFrameConstructor::ConstructTextControlFrame(nsIPresShell* aPresShell,
|
||||
return rv;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsCSSFrameConstructor::HasGfxScrollbars()
|
||||
{
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsCSSFrameConstructor::UseXBLForms()
|
||||
{
|
||||
@ -6062,75 +6024,35 @@ nsCSSFrameConstructor::BeginBuildingScrollFrame(nsIPresShell* aPresSh
|
||||
|
||||
nsRefPtr<nsStyleContext> contentStyle = aContentStyle;
|
||||
|
||||
PRBool isGfx = HasGfxScrollbars();
|
||||
if (!gfxScrollFrame) {
|
||||
NS_NewGfxScrollFrame(aPresShell, &gfxScrollFrame, aDocument, aIsRoot);
|
||||
|
||||
if (isGfx) {
|
||||
if (!gfxScrollFrame) {
|
||||
NS_NewGfxScrollFrame(aPresShell, &gfxScrollFrame, aDocument, aIsRoot);
|
||||
|
||||
InitAndRestoreFrame(aPresContext, aState, aContent,
|
||||
aParentFrame, contentStyle, nsnull, gfxScrollFrame);
|
||||
|
||||
// Create a view
|
||||
nsHTMLContainerFrame::CreateViewForFrame(aPresContext, gfxScrollFrame,
|
||||
contentStyle, aContentParentFrame, PR_FALSE);
|
||||
}
|
||||
|
||||
InitGfxScrollFrame(aPresShell, aPresContext, aState, aContent, aDocument,
|
||||
aParentFrame, aContentParentFrame, contentStyle,
|
||||
aIsRoot, gfxScrollFrame, anonymousItems, aScrollPortFrame);
|
||||
|
||||
scrollFrame = anonymousItems.childList; // get the scrollport from the anonymous list
|
||||
parentFrame = gfxScrollFrame;
|
||||
aNewFrame = gfxScrollFrame;
|
||||
|
||||
// we used the style that was passed in. So resolve another one.
|
||||
nsRefPtr<nsStyleContext> scrollPseudoStyle;
|
||||
scrollPseudoStyle = aPresContext->ResolvePseudoStyleContextFor(aContent,
|
||||
nsCSSAnonBoxes::scrolledContent,
|
||||
contentStyle);
|
||||
|
||||
contentStyle = scrollPseudoStyle;
|
||||
InitAndRestoreFrame(aPresContext, aState, aContent,
|
||||
parentFrame, contentStyle, nsnull, scrollFrame);
|
||||
aParentFrame, contentStyle, nsnull, gfxScrollFrame);
|
||||
|
||||
} else {
|
||||
// native scrollbarss
|
||||
NS_NewScrollFrame(aPresShell, &scrollFrame);
|
||||
aNewFrame = scrollFrame;
|
||||
parentFrame = aParentFrame;
|
||||
InitAndRestoreFrame(aPresContext, aState, aContent,
|
||||
parentFrame, contentStyle, nsnull, scrollFrame);
|
||||
|
||||
|
||||
// need to hook up the native scroll window's content parent
|
||||
if (nsnull != aContentParentFrame) {
|
||||
nsIView* view = nsnull;
|
||||
scrollFrame->GetView(aPresContext, &view);
|
||||
if (view) {
|
||||
nsCOMPtr<nsIViewManager> vm;
|
||||
view->GetViewManager(*getter_AddRefs(vm));
|
||||
nsIView* parentView;
|
||||
view->GetParent(parentView);
|
||||
|
||||
nsIView* zParentView = parentView;
|
||||
aContentParentFrame->GetView(aPresContext, &zParentView);
|
||||
|
||||
if (nsnull == zParentView) {
|
||||
nsIFrame* zParentFrame = nsnull;
|
||||
aContentParentFrame->GetParentWithView(aPresContext, &zParentFrame);
|
||||
NS_ASSERTION(zParentFrame, "GetParentWithView failed");
|
||||
zParentFrame->GetView(aPresContext, &zParentView);
|
||||
NS_ASSERTION(zParentView, "no parent with view");
|
||||
}
|
||||
|
||||
if (zParentView != parentView) {
|
||||
vm->InsertZPlaceholder(zParentView, view, nsnull, PR_TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Create a view
|
||||
nsHTMLContainerFrame::CreateViewForFrame(aPresContext, gfxScrollFrame,
|
||||
contentStyle, aContentParentFrame, PR_FALSE);
|
||||
}
|
||||
|
||||
InitGfxScrollFrame(aPresShell, aPresContext, aState, aContent, aDocument,
|
||||
aParentFrame, aContentParentFrame, contentStyle,
|
||||
aIsRoot, gfxScrollFrame, anonymousItems, aScrollPortFrame);
|
||||
|
||||
scrollFrame = anonymousItems.childList; // get the scrollport from the anonymous list
|
||||
parentFrame = gfxScrollFrame;
|
||||
aNewFrame = gfxScrollFrame;
|
||||
|
||||
// we used the style that was passed in. So resolve another one.
|
||||
nsRefPtr<nsStyleContext> scrollPseudoStyle;
|
||||
scrollPseudoStyle = aPresContext->ResolvePseudoStyleContextFor(aContent,
|
||||
nsCSSAnonBoxes::scrolledContent,
|
||||
contentStyle);
|
||||
|
||||
contentStyle = scrollPseudoStyle;
|
||||
InitAndRestoreFrame(aPresContext, aState, aContent,
|
||||
parentFrame, contentStyle, nsnull, scrollFrame);
|
||||
|
||||
nsStyleContext* aScrolledChildStyle = aPresContext->ResolvePseudoStyleContextFor(aContent,
|
||||
aScrolledPseudo,
|
||||
contentStyle).get();
|
||||
@ -6318,7 +6240,7 @@ nsCSSFrameConstructor::InitGfxScrollFrame(nsIPresShell* aPresShell,
|
||||
|
||||
aAnonymousFrames.AddChild(aScrollPortFrame);
|
||||
|
||||
// if there are any anonymous children for the nsScrollFrame create frames for them.
|
||||
// if there are any anonymous children for the nsGfxScrollFrame create frames for them.
|
||||
CreateAnonymousFrames(aPresShell, aPresContext, aState, aContent, aDocument, aNewFrame,
|
||||
PR_FALSE, aAnonymousFrames);
|
||||
|
||||
@ -7656,7 +7578,7 @@ nsCSSFrameConstructor::GetFrameFor(nsIPresShell* aPresShell,
|
||||
// Check to see if the content is a select and
|
||||
// then if it has a drop down (thus making it a combobox)
|
||||
// The drop down is a ListControlFrame derived from a
|
||||
// nsScrollFrame then get the area frame and that will be the parent
|
||||
// nsGfxScrollFrame then get the area frame and that will be the parent
|
||||
// What is unclear here, is if any of this fails, should it return
|
||||
// the nsComboboxControlFrame or null?
|
||||
nsCOMPtr<nsIDOMHTMLSelectElement> selectElement;
|
||||
|
@ -706,9 +706,7 @@ protected:
|
||||
nsStyleContext*& aScrolledChildStyle,
|
||||
nsIFrame* aScrollPort = nsnull);
|
||||
|
||||
// Builds the initial ScrollFrame:
|
||||
// if Gfx scrollbasrs in ares, it creates a GfxScrollFrame, otherwise it creates a ScrollFrame
|
||||
//
|
||||
// Builds the initial ScrollFrame
|
||||
already_AddRefed<nsStyleContext>
|
||||
BeginBuildingScrollFrame(nsIPresShell* aPresShell,
|
||||
nsIPresContext* aPresContext,
|
||||
@ -765,8 +763,6 @@ protected:
|
||||
PRBool aIsFixedPositioned,
|
||||
PRBool aCreateBlock);
|
||||
|
||||
// cache the "nglayout.widget.gfxscrollbars" pref
|
||||
PRBool HasGfxScrollbars();
|
||||
// cache the "nglayout.debug.enable_xbl_forms" pref
|
||||
PRBool UseXBLForms();
|
||||
|
||||
@ -1057,7 +1053,6 @@ protected:
|
||||
// Cached Prefs
|
||||
PRPackedBool mGotGfxPrefs;
|
||||
PRPackedBool mGotXBLFormPrefs;
|
||||
PRPackedBool mHasGfxScrollbars;
|
||||
PRPackedBool mUseXBLForms;
|
||||
|
||||
nsCOMPtr<nsILayoutHistoryState> mTempFrameTreeState;
|
||||
|
@ -75,10 +75,6 @@ CPPSRCS = \
|
||||
nsContentDLF.cpp \
|
||||
$(NULL)
|
||||
|
||||
ifndef MKSHLIB_FORCE_ALL
|
||||
CPPSRCS += dlldeps.cpp
|
||||
endif
|
||||
|
||||
EXPORTS = nsLayoutCID.h
|
||||
|
||||
SHARED_LIBRARY_LIBS = \
|
||||
|
@ -1,72 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
// Force references to all of the symbols that we want exported from
|
||||
// the dll that are located in the .lib files we link with
|
||||
|
||||
#include "nsString.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIPrintContext.h"
|
||||
#include "nsIPresContext.h"
|
||||
#include "nsIPrintPreviewContext.h"
|
||||
#include "nsIStyleSet.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsHTMLParts.h"
|
||||
|
||||
void XXXNeverCalled()
|
||||
{
|
||||
nsIPresShell* ps;
|
||||
NS_NewPresShell(&ps);
|
||||
nsIPresContext* cx;
|
||||
NS_NewGalleyContext(&cx);
|
||||
nsIPrintPreviewContext *ppx;
|
||||
NS_NewPrintPreviewContext(&ppx);
|
||||
nsIPrintContext *px;
|
||||
NS_NewPrintContext(&px);
|
||||
nsIFrame* f;
|
||||
NS_NewTextFrame(ps, &f);
|
||||
NS_NewInlineFrame(ps, &f);
|
||||
NS_NewBRFrame(ps, &f);
|
||||
NS_NewWBRFrame(ps, &f);
|
||||
NS_NewHRFrame(ps, &f);
|
||||
NS_NewObjectFrame(ps, &f);
|
||||
NS_NewSpacerFrame(ps, &f);
|
||||
NS_NewHTMLFramesetFrame(ps, &f);
|
||||
NS_NewCanvasFrame(ps, &f);
|
||||
NS_NewScrollFrame(ps, &f);
|
||||
NS_NewSimplePageSequenceFrame(ps, &f);
|
||||
}
|
@ -196,4 +196,4 @@ private:
|
||||
nsIPresContext* mPresContext; // weak reference
|
||||
};
|
||||
|
||||
#endif /* nsScrollFrame_h___ */
|
||||
#endif /* nsGfxScrollFrame_h___ */
|
||||
|
@ -95,7 +95,6 @@ CPPSRCS = \
|
||||
nsPageContentFrame.cpp \
|
||||
nsPlaceholderFrame.cpp \
|
||||
nsPresShell.cpp \
|
||||
nsScrollFrame.cpp \
|
||||
nsScrollPortFrame.cpp \
|
||||
nsSelectsAreaFrame.cpp \
|
||||
nsSimplePageSequence.cpp \
|
||||
|
@ -196,4 +196,4 @@ private:
|
||||
nsIPresContext* mPresContext; // weak reference
|
||||
};
|
||||
|
||||
#endif /* nsScrollFrame_h___ */
|
||||
#endif /* nsGfxScrollFrame_h___ */
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,192 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
#ifndef nsScrollFrame_h___
|
||||
#define nsScrollFrame_h___
|
||||
|
||||
#include "nsHTMLContainerFrame.h"
|
||||
#include "nsIScrollableFrame.h"
|
||||
#include "nsIStatefulFrame.h"
|
||||
|
||||
/**
|
||||
* The scroll frame creates and manages the scrolling view
|
||||
*
|
||||
* It only supports having a single child frame that typically is an area
|
||||
* frame, but doesn't have to be. The child frame must have a view, though
|
||||
*
|
||||
* Scroll frames don't support incremental changes, i.e. you can't replace
|
||||
* or remove the scrolled frame
|
||||
*/
|
||||
class nsScrollFrame : public nsHTMLContainerFrame,
|
||||
public nsIScrollableFrame,
|
||||
public nsIStatefulFrame
|
||||
{
|
||||
public:
|
||||
friend nsresult NS_NewScrollFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
|
||||
|
||||
NS_IMETHOD Init(nsIPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsStyleContext* aContext,
|
||||
nsIFrame* aPrevInFlow);
|
||||
|
||||
// Called to set the one and only child frame. Returns NS_ERROR_INVALID_ARG
|
||||
// if the child frame is NULL, and NS_ERROR_UNEXPECTED if the child list
|
||||
// contains more than one frame
|
||||
NS_IMETHOD SetInitialChildList(nsIPresContext* aPresContext,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aChildList);
|
||||
|
||||
// Because there can be only one child frame, these two function return
|
||||
// NS_ERROR_FAILURE
|
||||
NS_IMETHOD AppendFrames(nsIPresContext* aPresContext,
|
||||
nsIPresShell& aPresShell,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aFrameList);
|
||||
NS_IMETHOD InsertFrames(nsIPresContext* aPresContext,
|
||||
nsIPresShell& aPresShell,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aPrevFrame,
|
||||
nsIFrame* aFrameList);
|
||||
|
||||
// This function returns NS_ERROR_NOT_IMPLEMENTED
|
||||
NS_IMETHOD RemoveFrame(nsIPresContext* aPresContext,
|
||||
nsIPresShell& aPresShell,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aOldFrame);
|
||||
|
||||
NS_IMETHOD DidReflow(nsIPresContext* aPresContext,
|
||||
const nsHTMLReflowState* aReflowState,
|
||||
nsDidReflowStatus aStatus);
|
||||
|
||||
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
NS_IMETHOD Paint(nsIPresContext* aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect,
|
||||
nsFramePaintLayer aWhichLayer,
|
||||
PRUint32 aFlags = 0);
|
||||
|
||||
virtual PRBool CanPaintBackground() { return PR_FALSE; }
|
||||
|
||||
NS_IMETHOD GetFrameForPoint(nsIPresContext* aPresContext,
|
||||
const nsPoint& aPoint,
|
||||
nsFramePaintLayer aWhichLayer,
|
||||
nsIFrame** aFrame);
|
||||
|
||||
NS_IMETHOD GetScrollPreference(nsIPresContext* aPresContext, nsScrollPref* aScrollPreference) const;
|
||||
|
||||
NS_IMETHOD GetScrollbarSizes(nsIPresContext* aPresContext,
|
||||
nscoord *aVbarWidth,
|
||||
nscoord *aHbarHeight) const;
|
||||
|
||||
/**
|
||||
* Get the "type" of the frame
|
||||
*
|
||||
* @see nsLayoutAtoms::scrollFrame
|
||||
*/
|
||||
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
|
||||
|
||||
virtual PRBool SupportsVisibilityHidden() { return PR_FALSE; }
|
||||
|
||||
// nsIScrollableFrame
|
||||
NS_IMETHOD SetScrolledFrame(nsIPresContext* aPresContext, nsIFrame *aScrolledFrame);
|
||||
NS_IMETHOD GetScrolledFrame(nsIPresContext* aPresContext, nsIFrame *&aScrolledFrame) const;
|
||||
NS_IMETHOD GetScrollbarVisibility(nsIPresContext* aPresContext,
|
||||
PRBool *aVerticalVisible,
|
||||
PRBool *aHorizontalVisible) const;
|
||||
NS_IMETHOD GetScrollableView(nsIPresContext* aContext, nsIScrollableView** aResult) { return NS_OK; };
|
||||
|
||||
NS_IMETHOD SetScrollbarVisibility(nsIPresContext* aPresContext,
|
||||
PRBool aVerticalVisible,
|
||||
PRBool aHorizontalVisible);
|
||||
|
||||
NS_IMETHOD GetClipSize(nsIPresContext* aPresContext,
|
||||
nscoord *aWidth,
|
||||
nscoord *aHeight) const;
|
||||
|
||||
NS_IMETHOD GetScrollPosition(nsIPresContext* aContext, nscoord &aX, nscoord& aY) const;
|
||||
NS_IMETHOD ScrollTo(nsIPresContext* aContext, nscoord aX, nscoord aY, PRUint32 aFlags);
|
||||
NS_IMETHOD GetScrollbarBox(PRBool aVertical, nsIBox** aResult) { *aResult = nsnull; return NS_OK; };
|
||||
|
||||
// nsScrollFrame will die soon, anyway
|
||||
NS_IMETHOD CurPosAttributeChanged(nsIPresContext* aPresContext,
|
||||
nsIContent* aChild,
|
||||
PRInt32 aModType) { return NS_OK; }
|
||||
|
||||
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
|
||||
NS_IMETHOD_(nsrefcnt) AddRef(void) { return NS_OK; }
|
||||
NS_IMETHOD_(nsrefcnt) Release(void) { return NS_OK; }
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHOD GetFrameName(nsAString& aResult) const;
|
||||
#endif
|
||||
|
||||
//nsIStatefulFrame
|
||||
NS_IMETHOD SaveState(nsIPresContext* aPresContext, nsIPresState** aState);
|
||||
NS_IMETHOD RestoreState(nsIPresContext* aPresContext, nsIPresState* aState);
|
||||
|
||||
protected:
|
||||
nsScrollFrame();
|
||||
virtual PRIntn GetSkipSides() const;
|
||||
|
||||
// Creation of the widget for the scrolling view is factored into a virtual method so
|
||||
// that sub-classes may control widget creation.
|
||||
virtual nsresult CreateScrollingViewWidget(nsIView* aView, const nsStyleDisplay* aDisplay);
|
||||
// Getting the view for scollframe may be overriden to provide a parent view for te scroll frame
|
||||
virtual nsresult GetScrollingParentView(nsIPresContext* aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIView** aParentView);
|
||||
|
||||
private:
|
||||
nsresult CreateScrollingView(nsIPresContext* aPresContext);
|
||||
|
||||
nsresult CalculateScrollAreaSize(nsIPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsMargin& aMargin,
|
||||
nscoord aSBWidth,
|
||||
nscoord aSBHeight,
|
||||
nsSize* aScrollAreaSize,
|
||||
PRBool* aRoomForVerticalScrollbar);
|
||||
|
||||
nsresult CalculateChildTotalSize(nsIFrame* aKidFrame,
|
||||
nsHTMLReflowMetrics& aKidReflowMetrics);
|
||||
};
|
||||
|
||||
#endif /* nsScrollFrame_h___ */
|
@ -1363,10 +1363,8 @@ nsCSSFrameConstructor::Init(nsIDocument* aDocument)
|
||||
// This initializes the Prefs booleans
|
||||
mGotGfxPrefs = PR_FALSE;
|
||||
mGotXBLFormPrefs = PR_FALSE;
|
||||
mHasGfxScrollbars = PR_FALSE;
|
||||
mUseXBLForms = PR_FALSE;
|
||||
|
||||
HasGfxScrollbars();
|
||||
UseXBLForms();
|
||||
|
||||
return NS_OK;
|
||||
@ -3329,17 +3327,6 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresShell* aPresShell,
|
||||
|
||||
|
||||
|
||||
---------------Native Scrollbars------
|
||||
|
||||
|
||||
|
||||
ScrollFrame
|
||||
|
||||
^
|
||||
|
|
||||
AreaFrame or BoxFrame (InitialContainingBlock)
|
||||
|
||||
|
||||
---------------Gfx Scrollbars ------
|
||||
|
||||
|
||||
@ -3596,21 +3583,6 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell,
|
||||
|
||||
|
||||
|
||||
---------------Native Scrollbars------
|
||||
|
||||
|
||||
|
||||
ViewPortFrame (FixedContainingBlock) <---- RootView
|
||||
|
||||
^
|
||||
|
|
||||
ScrollFrame <--- RootScrollableView
|
||||
|
||||
^
|
||||
|
|
||||
RootFrame(DocElementContainingBlock)
|
||||
|
||||
|
||||
---------------Gfx Scrollbars ------
|
||||
|
||||
|
||||
@ -3897,11 +3869,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell,
|
||||
viewManager->SetRootScrollableView(scrollableView);
|
||||
parentFrame = newScrollableFrame;
|
||||
|
||||
// if gfx scrollbars store them
|
||||
if (HasGfxScrollbars())
|
||||
mGfxScrollFrame = newFrame;
|
||||
else
|
||||
mGfxScrollFrame = nsnull;
|
||||
mGfxScrollFrame = newFrame;
|
||||
|
||||
} else {
|
||||
// If no scrollbars and xul, don't build a scrollframe at all.
|
||||
@ -4228,12 +4196,6 @@ nsCSSFrameConstructor::ConstructTextControlFrame(nsIPresShell* aPresShell,
|
||||
return rv;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsCSSFrameConstructor::HasGfxScrollbars()
|
||||
{
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsCSSFrameConstructor::UseXBLForms()
|
||||
{
|
||||
@ -6062,75 +6024,35 @@ nsCSSFrameConstructor::BeginBuildingScrollFrame(nsIPresShell* aPresSh
|
||||
|
||||
nsRefPtr<nsStyleContext> contentStyle = aContentStyle;
|
||||
|
||||
PRBool isGfx = HasGfxScrollbars();
|
||||
if (!gfxScrollFrame) {
|
||||
NS_NewGfxScrollFrame(aPresShell, &gfxScrollFrame, aDocument, aIsRoot);
|
||||
|
||||
if (isGfx) {
|
||||
if (!gfxScrollFrame) {
|
||||
NS_NewGfxScrollFrame(aPresShell, &gfxScrollFrame, aDocument, aIsRoot);
|
||||
|
||||
InitAndRestoreFrame(aPresContext, aState, aContent,
|
||||
aParentFrame, contentStyle, nsnull, gfxScrollFrame);
|
||||
|
||||
// Create a view
|
||||
nsHTMLContainerFrame::CreateViewForFrame(aPresContext, gfxScrollFrame,
|
||||
contentStyle, aContentParentFrame, PR_FALSE);
|
||||
}
|
||||
|
||||
InitGfxScrollFrame(aPresShell, aPresContext, aState, aContent, aDocument,
|
||||
aParentFrame, aContentParentFrame, contentStyle,
|
||||
aIsRoot, gfxScrollFrame, anonymousItems, aScrollPortFrame);
|
||||
|
||||
scrollFrame = anonymousItems.childList; // get the scrollport from the anonymous list
|
||||
parentFrame = gfxScrollFrame;
|
||||
aNewFrame = gfxScrollFrame;
|
||||
|
||||
// we used the style that was passed in. So resolve another one.
|
||||
nsRefPtr<nsStyleContext> scrollPseudoStyle;
|
||||
scrollPseudoStyle = aPresContext->ResolvePseudoStyleContextFor(aContent,
|
||||
nsCSSAnonBoxes::scrolledContent,
|
||||
contentStyle);
|
||||
|
||||
contentStyle = scrollPseudoStyle;
|
||||
InitAndRestoreFrame(aPresContext, aState, aContent,
|
||||
parentFrame, contentStyle, nsnull, scrollFrame);
|
||||
aParentFrame, contentStyle, nsnull, gfxScrollFrame);
|
||||
|
||||
} else {
|
||||
// native scrollbarss
|
||||
NS_NewScrollFrame(aPresShell, &scrollFrame);
|
||||
aNewFrame = scrollFrame;
|
||||
parentFrame = aParentFrame;
|
||||
InitAndRestoreFrame(aPresContext, aState, aContent,
|
||||
parentFrame, contentStyle, nsnull, scrollFrame);
|
||||
|
||||
|
||||
// need to hook up the native scroll window's content parent
|
||||
if (nsnull != aContentParentFrame) {
|
||||
nsIView* view = nsnull;
|
||||
scrollFrame->GetView(aPresContext, &view);
|
||||
if (view) {
|
||||
nsCOMPtr<nsIViewManager> vm;
|
||||
view->GetViewManager(*getter_AddRefs(vm));
|
||||
nsIView* parentView;
|
||||
view->GetParent(parentView);
|
||||
|
||||
nsIView* zParentView = parentView;
|
||||
aContentParentFrame->GetView(aPresContext, &zParentView);
|
||||
|
||||
if (nsnull == zParentView) {
|
||||
nsIFrame* zParentFrame = nsnull;
|
||||
aContentParentFrame->GetParentWithView(aPresContext, &zParentFrame);
|
||||
NS_ASSERTION(zParentFrame, "GetParentWithView failed");
|
||||
zParentFrame->GetView(aPresContext, &zParentView);
|
||||
NS_ASSERTION(zParentView, "no parent with view");
|
||||
}
|
||||
|
||||
if (zParentView != parentView) {
|
||||
vm->InsertZPlaceholder(zParentView, view, nsnull, PR_TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Create a view
|
||||
nsHTMLContainerFrame::CreateViewForFrame(aPresContext, gfxScrollFrame,
|
||||
contentStyle, aContentParentFrame, PR_FALSE);
|
||||
}
|
||||
|
||||
InitGfxScrollFrame(aPresShell, aPresContext, aState, aContent, aDocument,
|
||||
aParentFrame, aContentParentFrame, contentStyle,
|
||||
aIsRoot, gfxScrollFrame, anonymousItems, aScrollPortFrame);
|
||||
|
||||
scrollFrame = anonymousItems.childList; // get the scrollport from the anonymous list
|
||||
parentFrame = gfxScrollFrame;
|
||||
aNewFrame = gfxScrollFrame;
|
||||
|
||||
// we used the style that was passed in. So resolve another one.
|
||||
nsRefPtr<nsStyleContext> scrollPseudoStyle;
|
||||
scrollPseudoStyle = aPresContext->ResolvePseudoStyleContextFor(aContent,
|
||||
nsCSSAnonBoxes::scrolledContent,
|
||||
contentStyle);
|
||||
|
||||
contentStyle = scrollPseudoStyle;
|
||||
InitAndRestoreFrame(aPresContext, aState, aContent,
|
||||
parentFrame, contentStyle, nsnull, scrollFrame);
|
||||
|
||||
nsStyleContext* aScrolledChildStyle = aPresContext->ResolvePseudoStyleContextFor(aContent,
|
||||
aScrolledPseudo,
|
||||
contentStyle).get();
|
||||
@ -6318,7 +6240,7 @@ nsCSSFrameConstructor::InitGfxScrollFrame(nsIPresShell* aPresShell,
|
||||
|
||||
aAnonymousFrames.AddChild(aScrollPortFrame);
|
||||
|
||||
// if there are any anonymous children for the nsScrollFrame create frames for them.
|
||||
// if there are any anonymous children for the nsGfxScrollFrame create frames for them.
|
||||
CreateAnonymousFrames(aPresShell, aPresContext, aState, aContent, aDocument, aNewFrame,
|
||||
PR_FALSE, aAnonymousFrames);
|
||||
|
||||
@ -7656,7 +7578,7 @@ nsCSSFrameConstructor::GetFrameFor(nsIPresShell* aPresShell,
|
||||
// Check to see if the content is a select and
|
||||
// then if it has a drop down (thus making it a combobox)
|
||||
// The drop down is a ListControlFrame derived from a
|
||||
// nsScrollFrame then get the area frame and that will be the parent
|
||||
// nsGfxScrollFrame then get the area frame and that will be the parent
|
||||
// What is unclear here, is if any of this fails, should it return
|
||||
// the nsComboboxControlFrame or null?
|
||||
nsCOMPtr<nsIDOMHTMLSelectElement> selectElement;
|
||||
|
@ -706,9 +706,7 @@ protected:
|
||||
nsStyleContext*& aScrolledChildStyle,
|
||||
nsIFrame* aScrollPort = nsnull);
|
||||
|
||||
// Builds the initial ScrollFrame:
|
||||
// if Gfx scrollbasrs in ares, it creates a GfxScrollFrame, otherwise it creates a ScrollFrame
|
||||
//
|
||||
// Builds the initial ScrollFrame
|
||||
already_AddRefed<nsStyleContext>
|
||||
BeginBuildingScrollFrame(nsIPresShell* aPresShell,
|
||||
nsIPresContext* aPresContext,
|
||||
@ -765,8 +763,6 @@ protected:
|
||||
PRBool aIsFixedPositioned,
|
||||
PRBool aCreateBlock);
|
||||
|
||||
// cache the "nglayout.widget.gfxscrollbars" pref
|
||||
PRBool HasGfxScrollbars();
|
||||
// cache the "nglayout.debug.enable_xbl_forms" pref
|
||||
PRBool UseXBLForms();
|
||||
|
||||
@ -1057,7 +1053,6 @@ protected:
|
||||
// Cached Prefs
|
||||
PRPackedBool mGotGfxPrefs;
|
||||
PRPackedBool mGotXBLFormPrefs;
|
||||
PRPackedBool mHasGfxScrollbars;
|
||||
PRPackedBool mUseXBLForms;
|
||||
|
||||
nsCOMPtr<nsILayoutHistoryState> mTempFrameTreeState;
|
||||
|
Loading…
x
Reference in New Issue
Block a user