зеркало из https://github.com/mozilla/gecko-dev.git
Bug 526394. Part 32: Remove code that only existed so that scrollframes could have views. r=mats
This commit is contained in:
Родитель
eefea0e5e3
Коммит
96a17b8b42
|
@ -4258,16 +4258,6 @@ nsCSSFrameConstructor::FinishBuildingScrollFrame(nsIFrame* aScrollFrame,
|
|||
{
|
||||
nsFrameList scrolled(aScrolledFrame, aScrolledFrame);
|
||||
aScrollFrame->AppendFrames(nsnull, scrolled);
|
||||
|
||||
// force the scrolled frame to have a view. The view will be parented to
|
||||
// the correct anonymous inner view because the scrollframes override
|
||||
// nsIFrame::GetParentViewForChildFrame.
|
||||
nsHTMLContainerFrame::CreateViewForFrame(aScrolledFrame, PR_TRUE);
|
||||
|
||||
// XXXbz what's the point of the code after this in this method?
|
||||
nsIView* view = aScrolledFrame->GetView();
|
||||
if (!view)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -570,12 +570,6 @@ nsContainerFrame::SyncFrameViewProperties(nsPresContext* aPresContext,
|
|||
|
||||
nsIViewManager* vm = aView->GetViewManager();
|
||||
|
||||
/* If this frame has a -moz-transform property, tell it to invalidate on a scroll
|
||||
* rather than doing a BitBlt.
|
||||
*/
|
||||
if (aFrame->GetStyleDisplay()->HasTransform())
|
||||
aView->SetInvalidateFrameOnScroll();
|
||||
|
||||
if (nsnull == aStyleContext) {
|
||||
aStyleContext = aFrame->GetStyleContext();
|
||||
}
|
||||
|
@ -612,18 +606,6 @@ nsContainerFrame::SyncFrameViewProperties(nsPresContext* aPresContext,
|
|||
vm->SetViewZIndex(aView, autoZIndex, zIndex, isPositioned);
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsContainerFrame::FrameNeedsView(nsIFrame* aFrame)
|
||||
{
|
||||
// XXX Check needed because frame construction can't properly figure out when
|
||||
// a frame is the child of a scrollframe
|
||||
if (aFrame->GetStyleContext()->GetPseudo() ==
|
||||
nsCSSAnonBoxes::scrolledContent) {
|
||||
return PR_TRUE;
|
||||
}
|
||||
return aFrame->NeedsView() || aFrame->GetStyleDisplay()->HasTransform();
|
||||
}
|
||||
|
||||
static nscoord GetCoord(const nsStyleCoord& aCoord, nscoord aIfNotCoord)
|
||||
{
|
||||
return aCoord.GetUnit() == eStyleUnit_Coord
|
||||
|
|
|
@ -149,9 +149,6 @@ public:
|
|||
nsIView* aView,
|
||||
PRUint32 aFlags = 0);
|
||||
|
||||
// Returns PR_TRUE if the frame requires a view
|
||||
static PRBool FrameNeedsView(nsIFrame* aFrame);
|
||||
|
||||
// Used by both nsInlineFrame and nsFirstLetterFrame.
|
||||
void DoInlineIntrinsicWidth(nsIRenderingContext *aRenderingContext,
|
||||
InlineIntrinsicWidthData *aData,
|
||||
|
|
|
@ -3424,12 +3424,6 @@ nsIFrame* nsIFrame::GetTailContinuation()
|
|||
return frame;
|
||||
}
|
||||
|
||||
nsIView*
|
||||
nsIFrame::GetParentViewForChildFrame(nsIFrame* aFrame) const
|
||||
{
|
||||
return GetClosestView();
|
||||
}
|
||||
|
||||
// Associated view object
|
||||
nsIView*
|
||||
nsIFrame::GetView() const
|
||||
|
|
|
@ -58,7 +58,6 @@
|
|||
#include "nsIView.h"
|
||||
#include "nsIViewManager.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIScrollableView.h"
|
||||
#include "nsWidgetsCID.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIDeviceContext.h"
|
||||
|
@ -756,12 +755,12 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIFrame* aFrame,
|
|||
}
|
||||
|
||||
// If we don't yet have a view, see if we need a view
|
||||
if (!(aForce || FrameNeedsView(aFrame))) {
|
||||
if (!aForce && !aFrame->NeedsView()) {
|
||||
// don't need a view
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsIView* parentView = aFrame->GetParent()->GetParentViewForChildFrame(aFrame);
|
||||
nsIView* parentView = aFrame->GetParent()->GetClosestView();
|
||||
NS_ASSERTION(parentView, "no parent with view");
|
||||
|
||||
nsIViewManager* viewManager = parentView->GetViewManager();
|
||||
|
@ -774,18 +773,11 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIFrame* aFrame,
|
|||
|
||||
SyncFrameViewProperties(aFrame->PresContext(), aFrame, nsnull, view);
|
||||
|
||||
// Insert the view into the view hierarchy. If the parent view is a
|
||||
// scrolling view we need to do this differently
|
||||
nsIScrollableView* scrollingView = parentView->ToScrollableView();
|
||||
if (scrollingView) {
|
||||
scrollingView->SetScrolledView(view);
|
||||
} else {
|
||||
nsIView* insertBefore = nsLayoutUtils::FindSiblingViewFor(parentView, aFrame);
|
||||
// we insert this view 'above' the insertBefore view, unless insertBefore is null,
|
||||
// in which case we want to call with aAbove == PR_FALSE to insert at the beginning
|
||||
// in document order
|
||||
viewManager->InsertChild(parentView, view, insertBefore, insertBefore != nsnull);
|
||||
}
|
||||
nsIView* insertBefore = nsLayoutUtils::FindSiblingViewFor(parentView, aFrame);
|
||||
// we insert this view 'above' the insertBefore view, unless insertBefore is null,
|
||||
// in which case we want to call with aAbove == PR_FALSE to insert at the beginning
|
||||
// in document order
|
||||
viewManager->InsertChild(parentView, view, insertBefore, insertBefore != nsnull);
|
||||
|
||||
// REVIEW: Don't create a widget for fixed-pos elements anymore.
|
||||
// ComputeRepaintRegionForCopy will calculate the right area to repaint
|
||||
|
|
|
@ -1015,7 +1015,7 @@ public:
|
|||
PRUint32 aFlags = 0);
|
||||
|
||||
/**
|
||||
* Does this frame type always need a view?
|
||||
* Does this frame need a view?
|
||||
*/
|
||||
virtual PRBool NeedsView() { return PR_FALSE; }
|
||||
|
||||
|
@ -1585,13 +1585,6 @@ public:
|
|||
virtual nsIView* GetViewExternal() const;
|
||||
nsresult SetView(nsIView* aView);
|
||||
|
||||
/**
|
||||
* This view will be used to parent the views of any children.
|
||||
* This allows us to insert an anonymous inner view to parent
|
||||
* some children.
|
||||
*/
|
||||
virtual nsIView* GetParentViewForChildFrame(nsIFrame* aFrame) const;
|
||||
|
||||
/**
|
||||
* Find the closest view (on |this| or an ancestor).
|
||||
* If aOffset is non-null, it will be set to the offset of |this|
|
||||
|
|
|
@ -84,7 +84,6 @@
|
|||
#include "nsIScrollableFrame.h"
|
||||
#include "nsWidgetsCID.h"
|
||||
#include "nsCSSAnonBoxes.h"
|
||||
#include "nsIScrollableView.h"
|
||||
#include "nsHTMLContainerFrame.h"
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
|
@ -1834,7 +1833,7 @@ nsBoxFrame::CreateViewForFrame(nsPresContext* aPresContext,
|
|||
zIndex = PR_INT32_MAX;
|
||||
}
|
||||
else {
|
||||
parentView = aFrame->GetParent()->GetParentViewForChildFrame(aFrame);
|
||||
parentView = aFrame->GetParent()->GetClosestView();
|
||||
}
|
||||
|
||||
NS_ASSERTION(parentView, "no parent view");
|
||||
|
@ -1842,16 +1841,9 @@ nsBoxFrame::CreateViewForFrame(nsPresContext* aPresContext,
|
|||
// Create a view
|
||||
nsIView *view = viewManager->CreateView(aFrame->GetRect(), parentView, visibility);
|
||||
if (view) {
|
||||
// Insert the view into the view hierarchy. If the parent view is a
|
||||
// scrolling view we need to do this differently
|
||||
nsIScrollableView* scrollingView = parentView->ToScrollableView();
|
||||
if (scrollingView) {
|
||||
scrollingView->SetScrolledView(view);
|
||||
} else {
|
||||
viewManager->SetViewZIndex(view, autoZIndex, zIndex);
|
||||
// XXX put view last in document order until we can do better
|
||||
viewManager->InsertChild(parentView, view, nsnull, PR_TRUE);
|
||||
}
|
||||
viewManager->SetViewZIndex(view, autoZIndex, zIndex);
|
||||
// XXX put view last in document order until we can do better
|
||||
viewManager->InsertChild(parentView, view, nsnull, PR_TRUE);
|
||||
}
|
||||
|
||||
// Remember our view
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
#include "nsWidgetInitData.h"
|
||||
|
||||
class nsIViewManager;
|
||||
class nsIScrollableView;
|
||||
class nsViewManager;
|
||||
class nsView;
|
||||
class nsWeakView;
|
||||
|
@ -86,11 +85,6 @@ enum nsViewVisibility {
|
|||
// is z-index:auto also
|
||||
#define NS_VIEW_FLAG_TOPMOST 0x0010
|
||||
|
||||
// If set, the view should always invalidate its frame
|
||||
// during a scroll instead of doing a BitBlt. This bit
|
||||
// is propagated down to children.
|
||||
#define NS_VIEW_FLAG_INVALIDATE_ON_SCROLL 0x0020
|
||||
|
||||
struct nsViewZIndex {
|
||||
PRBool mIsAuto;
|
||||
PRInt32 mZIndex;
|
||||
|
@ -120,12 +114,6 @@ class nsIView
|
|||
public:
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IVIEW_IID)
|
||||
|
||||
/**
|
||||
* See if this view is scrollable.
|
||||
* @result an nsIScrollableView* if the view is scrollable, or nsnull if not.
|
||||
*/
|
||||
virtual nsIScrollableView* ToScrollableView() { return nsnull; }
|
||||
|
||||
/**
|
||||
* Find the view for the given widget, if there is one.
|
||||
* @return the view the widget belongs to, or null if the widget doesn't
|
||||
|
@ -328,22 +316,6 @@ public:
|
|||
*/
|
||||
void DetachWidgetEventHandler(nsIWidget* aWidget);
|
||||
|
||||
/**
|
||||
* If called, will make the view invalidate its frame instead of BitBlitting
|
||||
* it when there's a scroll.
|
||||
*/
|
||||
void SetInvalidateFrameOnScroll()
|
||||
{
|
||||
mVFlags |= NS_VIEW_FLAG_INVALIDATE_ON_SCROLL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether or not we should automatically fail to BitBlt when scrolling.
|
||||
* This is true if either we're marked to have invalidate on scroll or if some
|
||||
* ancestor does.
|
||||
*/
|
||||
PRBool NeedsInvalidateFrameOnScroll() const;
|
||||
|
||||
#ifdef DEBUG
|
||||
/**
|
||||
* Output debug info to FILE
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
#include "nsGUIEvent.h"
|
||||
#include "nsIDeviceContext.h"
|
||||
#include "nsIComponentManager.h"
|
||||
#include "nsIScrollableView.h"
|
||||
#include "nsGfxCIID.h"
|
||||
#include "nsIRegion.h"
|
||||
#include "nsIInterfaceRequestor.h"
|
||||
|
@ -53,10 +52,9 @@ static nsEventStatus HandleEvent(nsGUIEvent *aEvent);
|
|||
|
||||
//#define SHOW_VIEW_BORDERS
|
||||
|
||||
// {34297A07-A8FD-d811-87C6-000244212BCB}
|
||||
#define VIEW_WRAPPER_IID \
|
||||
{ 0x34297a07, 0xa8fd, 0xd811, { 0x87, 0xc6, 0x0, 0x2, 0x44, 0x21, 0x2b, 0xcb } }
|
||||
|
||||
{ 0xbf4e1841, 0xe9ec, 0x47f2, \
|
||||
{ 0xb4, 0x77, 0x0f, 0xf6, 0x0f, 0x5a, 0xac, 0xbd } }
|
||||
|
||||
/**
|
||||
* nsISupports-derived helper class that allows to store and get a view
|
||||
|
@ -87,8 +85,7 @@ NS_IMETHODIMP ViewWrapper::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
|||
{
|
||||
NS_ENSURE_ARG_POINTER(aInstancePtr);
|
||||
|
||||
NS_ASSERTION(!aIID.Equals(NS_GET_IID(nsIView)) &&
|
||||
!aIID.Equals(NS_GET_IID(nsIScrollableView)),
|
||||
NS_ASSERTION(!aIID.Equals(NS_GET_IID(nsIView)),
|
||||
"Someone expects a viewwrapper to be a view!");
|
||||
|
||||
*aInstancePtr = nsnull;
|
||||
|
@ -115,10 +112,6 @@ NS_IMETHODIMP ViewWrapper::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
|||
|
||||
NS_IMETHODIMP ViewWrapper::GetInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
if (aIID.Equals(NS_GET_IID(nsIScrollableView))) {
|
||||
*aInstancePtr = mView->ToScrollableView();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(NS_GET_IID(nsIView))) {
|
||||
*aInstancePtr = mView;
|
||||
return NS_OK;
|
||||
|
@ -881,15 +874,3 @@ nsIView::SetDeletionObserver(nsWeakView* aDeletionObserver)
|
|||
}
|
||||
mDeletionObserver = aDeletionObserver;
|
||||
}
|
||||
|
||||
/* We invalidate the frame on a scroll iff this frame is marked as such or if
|
||||
* some parent is.
|
||||
*/
|
||||
PRBool nsIView::NeedsInvalidateFrameOnScroll() const
|
||||
{
|
||||
for (const nsIView *currView = this; currView != nsnull; currView = currView->GetParent())
|
||||
if (currView->mVFlags & NS_VIEW_FLAG_INVALIDATE_ON_SCROLL)
|
||||
return PR_TRUE;
|
||||
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче