1999-08-20 02:16:23 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
1999-11-06 06:40:37 +03:00
|
|
|
* 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/
|
1999-08-20 02:16:23 +04:00
|
|
|
*
|
1999-11-06 06:40:37 +03:00
|
|
|
* 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.
|
1999-08-20 02:16:23 +04:00
|
|
|
*
|
1999-11-06 06:40:37 +03:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape
|
1999-08-20 02:16:23 +04:00
|
|
|
* Communications Corporation. Portions created by Netscape are
|
1999-11-06 06:40:37 +03:00
|
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All
|
|
|
|
* Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
1999-08-20 02:16:23 +04:00
|
|
|
*/
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsHTMLParts.h"
|
|
|
|
#include "nsIPresContext.h"
|
|
|
|
#include "nsIStyleContext.h"
|
|
|
|
#include "nsIReflowCommand.h"
|
|
|
|
#include "nsIDeviceContext.h"
|
|
|
|
#include "nsPageFrame.h"
|
|
|
|
#include "nsViewsCID.h"
|
2000-01-25 09:35:27 +03:00
|
|
|
#include "nsIServiceManager.h"
|
1999-08-20 02:16:23 +04:00
|
|
|
#include "nsIView.h"
|
|
|
|
#include "nsIViewManager.h"
|
|
|
|
#include "nsHTMLContainerFrame.h"
|
|
|
|
#include "nsHTMLIIDs.h"
|
|
|
|
#include "nsCSSRendering.h"
|
|
|
|
#include "nsIScrollableView.h"
|
|
|
|
#include "nsWidgetsCID.h"
|
|
|
|
#include "nsGfxScrollFrame.h"
|
|
|
|
#include "nsLayoutAtoms.h"
|
|
|
|
#include "nsIXMLContent.h"
|
|
|
|
#include "nsXULAtoms.h"
|
|
|
|
#include "nsHTMLAtoms.h"
|
|
|
|
#include "nsINameSpaceManager.h"
|
|
|
|
#include "nsISupportsArray.h"
|
|
|
|
#include "nsIDocument.h"
|
|
|
|
#include "nsIFontMetrics.h"
|
1999-10-12 04:16:06 +04:00
|
|
|
#include "nsIDocumentObserver.h"
|
|
|
|
#include "nsIDocument.h"
|
|
|
|
#include "nsIScrollPositionListener.h"
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
//#include "nsBoxFrame.h"
|
2000-01-25 09:35:27 +03:00
|
|
|
#include "nsIElementFactory.h"
|
1999-08-20 02:16:23 +04:00
|
|
|
|
|
|
|
static NS_DEFINE_IID(kWidgetCID, NS_CHILD_CID);
|
|
|
|
static NS_DEFINE_IID(kScrollingViewCID, NS_SCROLLING_VIEW_CID);
|
|
|
|
static NS_DEFINE_IID(kViewCID, NS_VIEW_CID);
|
|
|
|
|
|
|
|
static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID);
|
|
|
|
static NS_DEFINE_IID(kScrollViewIID, NS_ISCROLLABLEVIEW_IID);
|
|
|
|
|
|
|
|
static NS_DEFINE_IID(kIAnonymousContentCreatorIID, NS_IANONYMOUS_CONTENT_CREATOR_IID);
|
1999-12-07 06:36:05 +03:00
|
|
|
static NS_DEFINE_IID(kIScrollableFrameIID, NS_ISCROLLABLE_FRAME_IID);
|
1999-08-20 02:16:23 +04:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
class nsGfxScrollFrameInner : public nsIDocumentObserver,
|
|
|
|
public nsIScrollPositionListener {
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
nsGfxScrollFrameInner(nsGfxScrollFrame* aOuter);
|
|
|
|
virtual ~nsGfxScrollFrameInner();
|
|
|
|
|
|
|
|
// nsIScrollPositionListener
|
|
|
|
|
1999-10-15 08:29:30 +04:00
|
|
|
NS_IMETHOD ScrollPositionWillChange(nsIScrollableView* aScrollable, nscoord aX, nscoord aY);
|
|
|
|
NS_IMETHOD ScrollPositionDidChange(nsIScrollableView* aScrollable, nscoord aX, nscoord aY);
|
1999-10-12 04:16:06 +04:00
|
|
|
|
|
|
|
// nsIDocumentObserver
|
|
|
|
NS_IMETHOD BeginUpdate(nsIDocument *aDocument) { return NS_OK; }
|
|
|
|
NS_IMETHOD EndUpdate(nsIDocument *aDocument) { return NS_OK; }
|
|
|
|
NS_IMETHOD BeginLoad(nsIDocument *aDocument) { return NS_OK; }
|
|
|
|
NS_IMETHOD EndLoad(nsIDocument *aDocument) { return NS_OK; }
|
|
|
|
NS_IMETHOD BeginReflow(nsIDocument *aDocument,
|
|
|
|
nsIPresShell* aShell) { return NS_OK; }
|
|
|
|
NS_IMETHOD EndReflow(nsIDocument *aDocument,
|
|
|
|
nsIPresShell* aShell) { return NS_OK; }
|
|
|
|
NS_IMETHOD ContentChanged(nsIDocument* aDoc,
|
|
|
|
nsIContent* aContent,
|
|
|
|
nsISupports* aSubContent) { return NS_OK; }
|
|
|
|
NS_IMETHOD ContentStatesChanged(nsIDocument* aDocument,
|
|
|
|
nsIContent* aContent1,
|
|
|
|
nsIContent* aContent2) { return NS_OK; }
|
|
|
|
NS_IMETHOD AttributeChanged(nsIDocument *aDocument,
|
|
|
|
nsIContent* aContent,
|
1999-10-16 03:16:45 +04:00
|
|
|
PRInt32 aNameSpaceID,
|
1999-10-12 04:16:06 +04:00
|
|
|
nsIAtom* aAttribute,
|
|
|
|
PRInt32 aHint);
|
|
|
|
NS_IMETHOD ContentAppended(nsIDocument *aDocument,
|
|
|
|
nsIContent* aContainer,
|
|
|
|
PRInt32 aNewIndexInContainer) { return NS_OK; }
|
|
|
|
NS_IMETHOD ContentInserted(nsIDocument *aDocument,
|
|
|
|
nsIContent* aContainer,
|
|
|
|
nsIContent* aChild,
|
|
|
|
PRInt32 aIndexInContainer) { return NS_OK; }
|
|
|
|
NS_IMETHOD ContentReplaced(nsIDocument *aDocument,
|
|
|
|
nsIContent* aContainer,
|
|
|
|
nsIContent* aOldChild,
|
|
|
|
nsIContent* aNewChild,
|
|
|
|
PRInt32 aIndexInContainer) { return NS_OK; }
|
|
|
|
NS_IMETHOD ContentRemoved(nsIDocument *aDocument,
|
|
|
|
nsIContent* aContainer,
|
|
|
|
nsIContent* aChild,
|
|
|
|
PRInt32 aIndexInContainer) { return NS_OK; }
|
|
|
|
NS_IMETHOD StyleSheetAdded(nsIDocument *aDocument,
|
|
|
|
nsIStyleSheet* aStyleSheet) { return NS_OK; }
|
|
|
|
NS_IMETHOD StyleSheetRemoved(nsIDocument *aDocument,
|
|
|
|
nsIStyleSheet* aStyleSheet) { return NS_OK; }
|
|
|
|
NS_IMETHOD StyleSheetDisabledStateChanged(nsIDocument *aDocument,
|
|
|
|
nsIStyleSheet* aStyleSheet,
|
|
|
|
PRBool aDisabled) { return NS_OK; }
|
|
|
|
NS_IMETHOD StyleRuleChanged(nsIDocument *aDocument,
|
|
|
|
nsIStyleSheet* aStyleSheet,
|
|
|
|
nsIStyleRule* aStyleRule,
|
|
|
|
PRInt32 aHint) { return NS_OK; }
|
|
|
|
NS_IMETHOD StyleRuleAdded(nsIDocument *aDocument,
|
|
|
|
nsIStyleSheet* aStyleSheet,
|
|
|
|
nsIStyleRule* aStyleRule) { return NS_OK; }
|
|
|
|
NS_IMETHOD StyleRuleRemoved(nsIDocument *aDocument,
|
|
|
|
nsIStyleSheet* aStyleSheet,
|
|
|
|
nsIStyleRule* aStyleRule) { return NS_OK; }
|
|
|
|
NS_IMETHOD DocumentWillBeDestroyed(nsIDocument *aDocument) { mDocument = nsnull; return NS_OK; }
|
|
|
|
|
|
|
|
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
PRBool SetAttribute(nsIFrame* aFrame, nsIAtom* aAtom, nscoord aSize, PRBool aReflow=PR_TRUE);
|
1999-10-12 04:16:06 +04:00
|
|
|
PRInt32 GetIntegerAttribute(nsIFrame* aFrame, nsIAtom* atom, PRInt32 defaultValue);
|
|
|
|
|
|
|
|
nsresult CalculateChildTotalSize(nsIFrame* aKidFrame,
|
|
|
|
nsHTMLReflowMetrics& aKidReflowMetrics);
|
|
|
|
|
|
|
|
nsresult GetFrameSize( nsIFrame* aFrame,
|
|
|
|
nsSize& aSize);
|
|
|
|
|
1999-10-26 08:44:41 +04:00
|
|
|
nsresult SetFrameSize( nsIPresContext* aPresContext,
|
|
|
|
nsIFrame* aFrame,
|
1999-10-12 04:16:06 +04:00
|
|
|
nsSize aSize);
|
|
|
|
|
1999-11-24 09:03:41 +03:00
|
|
|
nsresult CalculateScrollAreaSize(nsIPresContext* aPresContext,
|
1999-10-12 04:16:06 +04:00
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
const nsSize& aSbSize,
|
|
|
|
nsSize& aScrollAreaSize);
|
|
|
|
|
|
|
|
void SetScrollbarVisibility(nsIFrame* aScrollbar, PRBool aVisible);
|
|
|
|
|
|
|
|
|
|
|
|
|
1999-11-24 09:03:41 +03:00
|
|
|
void ReflowScrollbars( nsIPresContext* aPresContext,
|
1999-10-12 04:16:06 +04:00
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsReflowStatus& aStatus,
|
|
|
|
nsIFrame*& aIncrementalChild);
|
|
|
|
|
1999-11-24 09:03:41 +03:00
|
|
|
void ReflowScrollbar( nsIPresContext* aPresContext,
|
1999-10-12 04:16:06 +04:00
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsReflowStatus& aStatus,
|
|
|
|
PRBool& aScrollBarResized,
|
|
|
|
nsIFrame* aScrollBarFrame,
|
|
|
|
nsIFrame*& aIncrementalChild);
|
|
|
|
|
|
|
|
|
1999-11-24 09:03:41 +03:00
|
|
|
nsresult ReflowFrame( nsIPresContext* aPresContext,
|
1999-10-12 04:16:06 +04:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsReflowStatus& aStatus,
|
|
|
|
nsIFrame* aFrame,
|
|
|
|
const nsSize& aAvailable,
|
|
|
|
const nsSize& aComputed,
|
|
|
|
PRBool& aResized,
|
|
|
|
nsIFrame*& aIncrementalChild);
|
|
|
|
|
1999-11-24 09:03:41 +03:00
|
|
|
void ReflowScrollArea( nsIPresContext* aPresContext,
|
1999-10-12 04:16:06 +04:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsReflowStatus& aStatus,
|
|
|
|
nsIFrame*& aIncrementalChild);
|
|
|
|
|
1999-11-24 09:03:41 +03:00
|
|
|
void LayoutChildren(nsIPresContext* aPresContext,
|
1999-10-12 04:16:06 +04:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState);
|
|
|
|
|
1999-11-24 09:03:41 +03:00
|
|
|
void GetScrollbarDimensions(nsIPresContext* aPresContext,
|
1999-10-12 04:16:06 +04:00
|
|
|
nsSize& aSbSize);
|
|
|
|
|
|
|
|
void AddRemoveScrollbar (PRBool& aHasScrollbar, nscoord& aSize, nscoord aSbSize, PRBool aAdd);
|
|
|
|
void AddHorizontalScrollbar (const nsSize& aSbSize, nsSize& aScrollAreaSize);
|
|
|
|
void AddVerticalScrollbar (const nsSize& aSbSize, nsSize& aScrollAreaSize);
|
|
|
|
void RemoveHorizontalScrollbar(const nsSize& aSbSize, nsSize& aScrollAreaSize);
|
|
|
|
void RemoveVerticalScrollbar (const nsSize& aSbSize, nsSize& aScrollAreaSize);
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
PRBool IsDirty(nsIFrame* aFrame) {
|
|
|
|
nsFrameState frameState;
|
|
|
|
aFrame->GetFrameState(&frameState);
|
|
|
|
if (frameState & NS_FRAME_IS_DIRTY)
|
|
|
|
return PR_TRUE;
|
|
|
|
else
|
|
|
|
return PR_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
void MarkDirty(nsIFrame* aFrame) {
|
|
|
|
nsFrameState frameState;
|
|
|
|
aFrame->GetFrameState(&frameState);
|
|
|
|
frameState |= NS_FRAME_IS_DIRTY;
|
|
|
|
aFrame->SetFrameState(frameState);
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
1999-10-26 08:44:41 +04:00
|
|
|
nsIScrollableView* GetScrollableView(nsIPresContext* aPresContext);
|
1999-10-12 04:16:06 +04:00
|
|
|
|
2000-01-22 04:16:50 +03:00
|
|
|
void GetScrolledContentSize(nsIPresContext* aPresContext, nsSize& aSize);
|
1999-10-12 04:16:06 +04:00
|
|
|
|
1999-10-26 08:44:41 +04:00
|
|
|
void ScrollbarChanged(nsIPresContext* aPresContext, nscoord aX, nscoord aY);
|
1999-10-12 04:16:06 +04:00
|
|
|
nsresult GetContentOf(nsIFrame* aFrame, nsIContent** aContent);
|
|
|
|
|
|
|
|
nsIFrame* mHScrollbarFrame;
|
|
|
|
nsIFrame* mVScrollbarFrame;
|
|
|
|
nsIFrame* mScrollAreaFrame;
|
|
|
|
nscoord mOnePixel;
|
|
|
|
nsCOMPtr<nsIDocument> mDocument;
|
|
|
|
nsGfxScrollFrame* mOuter;
|
|
|
|
nsIScrollableView* mScrollableView;
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
nsSize mMaxElementSize;
|
|
|
|
|
|
|
|
PRBool mHasVerticalScrollbar;
|
|
|
|
PRBool mHasHorizontalScrollbar;
|
|
|
|
PRBool mFirstPass;
|
|
|
|
PRBool mIsRoot;
|
2000-02-11 00:36:28 +03:00
|
|
|
PRBool mNeverReflowed;
|
1999-10-12 04:16:06 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
NS_IMPL_ISUPPORTS2(nsGfxScrollFrameInner, nsIDocumentObserver, nsIScrollPositionListener)
|
|
|
|
|
1999-08-20 02:16:23 +04:00
|
|
|
nsresult
|
1999-12-05 02:49:50 +03:00
|
|
|
NS_NewGfxScrollFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame, nsIDocument* aDocument)
|
1999-08-20 02:16:23 +04:00
|
|
|
{
|
|
|
|
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
|
|
|
if (nsnull == aNewFrame) {
|
|
|
|
return NS_ERROR_NULL_POINTER;
|
|
|
|
}
|
1999-12-05 02:49:50 +03:00
|
|
|
nsGfxScrollFrame* it = new (aPresShell) nsGfxScrollFrame(aDocument);
|
1999-08-20 02:16:23 +04:00
|
|
|
if (nsnull == it) {
|
|
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
}
|
|
|
|
*aNewFrame = it;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
nsGfxScrollFrame::nsGfxScrollFrame(nsIDocument* aDocument)
|
1999-08-20 02:16:23 +04:00
|
|
|
{
|
1999-10-12 04:16:06 +04:00
|
|
|
mInner = new nsGfxScrollFrameInner(this);
|
|
|
|
mInner->AddRef();
|
|
|
|
mInner->mDocument = aDocument;
|
1999-10-26 08:44:41 +04:00
|
|
|
mPresContext = nsnull;
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
mInner->mIsRoot = PR_FALSE;
|
2000-02-11 00:36:28 +03:00
|
|
|
mInner->mNeverReflowed = PR_TRUE;
|
1999-10-12 04:16:06 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
nsGfxScrollFrame::~nsGfxScrollFrame()
|
|
|
|
{
|
|
|
|
mInner->mOuter = nsnull;
|
|
|
|
mInner->Release();
|
1999-10-26 08:44:41 +04:00
|
|
|
mPresContext = nsnull;
|
1999-08-20 02:16:23 +04:00
|
|
|
}
|
|
|
|
|
1999-12-07 06:36:05 +03:00
|
|
|
/**
|
|
|
|
* Set the view that we are scrolling within the scrolling view.
|
|
|
|
*/
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsGfxScrollFrame::SetScrolledFrame(nsIPresContext* aPresContext, nsIFrame *aScrolledFrame)
|
|
|
|
{
|
|
|
|
mFrames.DestroyFrame(aPresContext, mInner->mScrollAreaFrame);
|
|
|
|
mInner->mScrollAreaFrame = aScrolledFrame;
|
|
|
|
mFrames.InsertFrame(nsnull, nsnull, mInner->mScrollAreaFrame);
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the view that we are scrolling within the scrolling view.
|
|
|
|
* @result child view
|
|
|
|
*/
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsGfxScrollFrame::GetScrolledFrame(nsIPresContext* aPresContext, nsIFrame *&aScrolledFrame) const
|
|
|
|
{
|
2000-01-22 04:16:50 +03:00
|
|
|
return mInner->mScrollAreaFrame->FirstChild(aPresContext, nsnull, &aScrolledFrame);
|
1999-12-07 06:36:05 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the size of the area that lies inside the scrollbars but clips the scrolled frame
|
|
|
|
*/
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsGfxScrollFrame::GetClipSize(nsIPresContext* aPresContext,
|
|
|
|
nscoord *aWidth,
|
|
|
|
nscoord *aHeight) const
|
|
|
|
{
|
|
|
|
nsSize size;
|
|
|
|
mInner->mScrollAreaFrame->GetSize(size);
|
|
|
|
*aWidth = size.width;
|
|
|
|
*aHeight = size.height;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get information about whether the vertical and horizontal scrollbars
|
|
|
|
* are currently visible
|
|
|
|
*/
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsGfxScrollFrame::GetScrollbarVisibility(nsIPresContext* aPresContext,
|
|
|
|
PRBool *aVerticalVisible,
|
|
|
|
PRBool *aHorizontalVisible) const
|
|
|
|
{
|
|
|
|
*aVerticalVisible = mInner->mHasVerticalScrollbar;
|
|
|
|
*aHorizontalVisible = mInner->mHasHorizontalScrollbar;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
1999-08-20 02:16:23 +04:00
|
|
|
nsresult NS_CreateAnonymousNode(nsIContent* aParent, nsIAtom* aTag, PRInt32 aNameSpaceId, nsCOMPtr<nsIContent>& aNewNode);
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2000-01-22 04:16:50 +03:00
|
|
|
nsGfxScrollFrame::CreateAnonymousContent(nsIPresContext* aPresContext,
|
|
|
|
nsISupportsArray& aAnonymousChildren)
|
1999-08-20 02:16:23 +04:00
|
|
|
{
|
|
|
|
// create horzontal scrollbar
|
2000-01-25 09:35:27 +03:00
|
|
|
nsCAutoString progID = NS_ELEMENT_FACTORY_PROGID_PREFIX;
|
|
|
|
progID += "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
|
|
|
nsresult rv;
|
|
|
|
NS_WITH_SERVICE(nsIElementFactory, elementFactory, progID, &rv);
|
|
|
|
if (!elementFactory)
|
|
|
|
return NS_ERROR_FAILURE;
|
1999-08-20 02:16:23 +04:00
|
|
|
|
|
|
|
nsCOMPtr<nsIContent> content;
|
Landing changes Vidur made while the tree was closed for beta1 work, here's a list of the changes. r=me
[1] Cutting down the size of content. Made nsIJSScriptObject inherit from nsIScriptObjectOwner
[2] Cutting down the size of content. Made nsITextContent inherit from nsIContent.
[3] Cutting down the size of content. Moved implementation of nsIDOMReceiver to nsListenerManager. This is not true aggregation since it isn't transitive, but it's OK for now. It will be necessary for nsListenerManager to have a reference to its content in the future anyway, so the transitivity could be done.
dom/public/nsDOMPropEnums.h,v - bug 12559
dom/public/nsIJSScriptObject.h,v - [1]
dom/public/html/MANIFEST,v - bug 12559
dom/public/html/Makefile.in,v - bug 12559
dom/public/html/makefile.win,v - bug 12559
dom/public/html/nsIDOMHTMLInputElement.h,v - bug 17544
dom/public/idl/html/HTMLAnchorElement.idl,v - bug 12559
dom/public/idl/html/HTMLAreaElement.idl,v - bug 12559
dom/public/idl/html/HTMLInputElement.idl,v - bug 17544
dom/src/base/nsGlobalWindow.cpp,v - bug 30700
dom/src/base/nsGlobalWindow.h,v - [1]
dom/src/base/nsLocation.cpp,v - [1]
dom/src/html/nsJSHTMLAnchorElement.cpp,v - bug 12559
dom/src/html/nsJSHTMLAreaElement.cpp,v - bug 12559
dom/src/html/nsJSHTMLInputElement.cpp,v - bug 17544
layout/base/public/nsIDocument.h,v - bug 27953
layout/base/public/nsITextContent.h,v - [2]
layout/base/src/nsCommentNode.cpp,v - [2]
layout/base/src/nsDocument.cpp,v - bug 27953
layout/base/src/nsDocument.h,v - bug 27953
layout/base/src/nsDocumentViewer.cpp,v - bug 27953
layout/base/src/nsGenericDOMDataNode.cpp,v - [3]
layout/base/src/nsGenericDOMDataNode.h,v - [3]
layout/base/src/nsGenericElement.cpp,v - [3]
layout/base/src/nsGenericElement.h,v - [3]
layout/base/src/nsNameSpaceManager.cpp,v - bug 7834
layout/base/src/nsStyleContext.cpp,v - outline property shouldn't reflow
layout/base/src/nsTextNode.cpp,v - [2]
layout/events/src/nsEventListenerManager.cpp,v - [3]
layout/events/src/nsEventListenerManager.h,v - [3]
layout/html/base/src/nsGfxScrollFrame.cpp,v - nsString->nsAutoString
layout/html/content/src/nsAttributeContent.cpp,v - [2]
layout/html/content/src/nsHTMLAnchorElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLAppletElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLAreaElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBRElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBaseElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBaseFontElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBodyElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLButtonElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDListElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDelElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDirectoryElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDivElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLEmbedElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFieldSetElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFontElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFormElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFrameElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFrameSetElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHRElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHeadElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHeadingElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHtmlElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLIFrameElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLImageElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLInputElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLInsElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLIsIndexElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLIElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLabelElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLayerElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLegendElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLinkElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLMapElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLMenuElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLMetaElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLModElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLOListElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLObjectElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLOptGroupElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLOptionElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLParagraphElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLParamElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLPreElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLQuoteElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLScriptElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLSelectElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLSpacerElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLSpanElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLStyleElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableCaptionElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableCellElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableColElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableColGroupElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableRowElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableSectionElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTextAreaElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTitleElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLUListElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLWBRElement.cpp,v - [1][3]
layout/html/document/src/nsHTMLDocument.cpp,v - bug 27953
layout/html/document/src/nsHTMLDocument.h,v - bug 27953
layout/xml/content/src/nsXMLCDATASection.cpp,v - [1][2]
layout/xml/content/src/nsXMLDocumentType.cpp,v - [1][2]
layout/xml/content/src/nsXMLElement.h,v - [1][2]
layout/xml/content/src/nsXMLEntity.cpp,v - [1][2]
layout/xml/content/src/nsXMLNotation.cpp,v - [1][2]
layout/xml/content/src/nsXMLProcessingInstruction.cpp,v - [1][2]
layout/xul/base/src/nsBoxFrame.cpp,v - nsString->nsAutoString
layout/xul/base/src/nsSliderFrame.cpp,v - nsString->nsAutoString
netwerk/protocol/http/src/nsHTTPRequest.cpp,v - nsString->nsAutoString
rdf/content/src/nsXULDocument.cpp,v - bug 27953
rdf/content/src/nsXULDocument.h,v - bug 27953
rdf/content/src/nsXULElement.h,v - [1]
xpcom/base/IIDS.h,v - bug 12559
2000-03-17 16:27:00 +03:00
|
|
|
elementFactory->CreateInstanceByTag(nsAutoString("scrollbar"), getter_AddRefs(content));
|
|
|
|
content->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::align, nsAutoString("horizontal"), PR_FALSE);
|
1999-08-20 02:16:23 +04:00
|
|
|
aAnonymousChildren.AppendElement(content);
|
|
|
|
|
|
|
|
// create vertical scrollbar
|
2000-01-25 09:35:27 +03:00
|
|
|
content = nsnull;
|
Landing changes Vidur made while the tree was closed for beta1 work, here's a list of the changes. r=me
[1] Cutting down the size of content. Made nsIJSScriptObject inherit from nsIScriptObjectOwner
[2] Cutting down the size of content. Made nsITextContent inherit from nsIContent.
[3] Cutting down the size of content. Moved implementation of nsIDOMReceiver to nsListenerManager. This is not true aggregation since it isn't transitive, but it's OK for now. It will be necessary for nsListenerManager to have a reference to its content in the future anyway, so the transitivity could be done.
dom/public/nsDOMPropEnums.h,v - bug 12559
dom/public/nsIJSScriptObject.h,v - [1]
dom/public/html/MANIFEST,v - bug 12559
dom/public/html/Makefile.in,v - bug 12559
dom/public/html/makefile.win,v - bug 12559
dom/public/html/nsIDOMHTMLInputElement.h,v - bug 17544
dom/public/idl/html/HTMLAnchorElement.idl,v - bug 12559
dom/public/idl/html/HTMLAreaElement.idl,v - bug 12559
dom/public/idl/html/HTMLInputElement.idl,v - bug 17544
dom/src/base/nsGlobalWindow.cpp,v - bug 30700
dom/src/base/nsGlobalWindow.h,v - [1]
dom/src/base/nsLocation.cpp,v - [1]
dom/src/html/nsJSHTMLAnchorElement.cpp,v - bug 12559
dom/src/html/nsJSHTMLAreaElement.cpp,v - bug 12559
dom/src/html/nsJSHTMLInputElement.cpp,v - bug 17544
layout/base/public/nsIDocument.h,v - bug 27953
layout/base/public/nsITextContent.h,v - [2]
layout/base/src/nsCommentNode.cpp,v - [2]
layout/base/src/nsDocument.cpp,v - bug 27953
layout/base/src/nsDocument.h,v - bug 27953
layout/base/src/nsDocumentViewer.cpp,v - bug 27953
layout/base/src/nsGenericDOMDataNode.cpp,v - [3]
layout/base/src/nsGenericDOMDataNode.h,v - [3]
layout/base/src/nsGenericElement.cpp,v - [3]
layout/base/src/nsGenericElement.h,v - [3]
layout/base/src/nsNameSpaceManager.cpp,v - bug 7834
layout/base/src/nsStyleContext.cpp,v - outline property shouldn't reflow
layout/base/src/nsTextNode.cpp,v - [2]
layout/events/src/nsEventListenerManager.cpp,v - [3]
layout/events/src/nsEventListenerManager.h,v - [3]
layout/html/base/src/nsGfxScrollFrame.cpp,v - nsString->nsAutoString
layout/html/content/src/nsAttributeContent.cpp,v - [2]
layout/html/content/src/nsHTMLAnchorElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLAppletElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLAreaElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBRElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBaseElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBaseFontElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBodyElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLButtonElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDListElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDelElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDirectoryElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDivElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLEmbedElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFieldSetElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFontElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFormElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFrameElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFrameSetElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHRElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHeadElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHeadingElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHtmlElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLIFrameElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLImageElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLInputElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLInsElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLIsIndexElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLIElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLabelElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLayerElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLegendElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLinkElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLMapElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLMenuElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLMetaElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLModElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLOListElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLObjectElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLOptGroupElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLOptionElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLParagraphElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLParamElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLPreElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLQuoteElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLScriptElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLSelectElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLSpacerElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLSpanElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLStyleElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableCaptionElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableCellElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableColElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableColGroupElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableRowElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableSectionElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTextAreaElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTitleElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLUListElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLWBRElement.cpp,v - [1][3]
layout/html/document/src/nsHTMLDocument.cpp,v - bug 27953
layout/html/document/src/nsHTMLDocument.h,v - bug 27953
layout/xml/content/src/nsXMLCDATASection.cpp,v - [1][2]
layout/xml/content/src/nsXMLDocumentType.cpp,v - [1][2]
layout/xml/content/src/nsXMLElement.h,v - [1][2]
layout/xml/content/src/nsXMLEntity.cpp,v - [1][2]
layout/xml/content/src/nsXMLNotation.cpp,v - [1][2]
layout/xml/content/src/nsXMLProcessingInstruction.cpp,v - [1][2]
layout/xul/base/src/nsBoxFrame.cpp,v - nsString->nsAutoString
layout/xul/base/src/nsSliderFrame.cpp,v - nsString->nsAutoString
netwerk/protocol/http/src/nsHTTPRequest.cpp,v - nsString->nsAutoString
rdf/content/src/nsXULDocument.cpp,v - bug 27953
rdf/content/src/nsXULDocument.h,v - bug 27953
rdf/content/src/nsXULElement.h,v - [1]
xpcom/base/IIDS.h,v - bug 12559
2000-03-17 16:27:00 +03:00
|
|
|
elementFactory->CreateInstanceByTag(nsAutoString("scrollbar"), getter_AddRefs(content));
|
|
|
|
content->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::align, nsAutoString("vertical"), PR_FALSE);
|
1999-08-20 02:16:23 +04:00
|
|
|
aAnonymousChildren.AppendElement(content);
|
|
|
|
|
|
|
|
// XXX For GFX never have scrollbars
|
|
|
|
// mScrollableView->SetScrollPreference(nsScrollPreference_kNeverScroll);
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
1999-11-24 09:03:41 +03:00
|
|
|
nsGfxScrollFrame::Destroy(nsIPresContext* aPresContext)
|
1999-08-20 02:16:23 +04:00
|
|
|
|
|
|
|
{
|
|
|
|
return nsHTMLContainerFrame::Destroy(aPresContext);
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
1999-11-24 09:03:41 +03:00
|
|
|
nsGfxScrollFrame::Init(nsIPresContext* aPresContext,
|
1999-08-20 02:16:23 +04:00
|
|
|
nsIContent* aContent,
|
|
|
|
nsIFrame* aParent,
|
|
|
|
nsIStyleContext* aStyleContext,
|
|
|
|
nsIFrame* aPrevInFlow)
|
|
|
|
{
|
1999-11-24 09:03:41 +03:00
|
|
|
mPresContext = aPresContext;
|
1999-08-20 02:16:23 +04:00
|
|
|
nsresult rv = nsHTMLContainerFrame::Init(aPresContext, aContent,
|
|
|
|
aParent, aStyleContext,
|
|
|
|
aPrevInFlow);
|
1999-10-12 04:16:06 +04:00
|
|
|
|
|
|
|
// nsCOMPtr<nsIContent> content;
|
|
|
|
// mInner->GetContentOf(this, getter_AddRefs(content));
|
|
|
|
|
|
|
|
// content->GetDocument(*getter_AddRefs(mInner->mDocument));
|
|
|
|
mInner->mDocument->AddObserver(mInner);
|
1999-08-20 02:16:23 +04:00
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
1999-11-24 09:03:41 +03:00
|
|
|
nsGfxScrollFrame::SetInitialChildList(nsIPresContext* aPresContext,
|
1999-08-20 02:16:23 +04:00
|
|
|
nsIAtom* aListName,
|
|
|
|
nsIFrame* aChildList)
|
|
|
|
{
|
|
|
|
nsresult rv = nsHTMLContainerFrame::SetInitialChildList(aPresContext, aListName,
|
|
|
|
aChildList);
|
|
|
|
// get scroll area
|
1999-10-12 04:16:06 +04:00
|
|
|
mInner->mScrollAreaFrame = mFrames.FirstChild();
|
1999-08-20 02:16:23 +04:00
|
|
|
|
|
|
|
// horizontal scrollbar
|
1999-10-12 04:16:06 +04:00
|
|
|
mInner->mScrollAreaFrame->GetNextSibling(&mInner->mHScrollbarFrame);
|
1999-08-20 02:16:23 +04:00
|
|
|
|
|
|
|
// vertical scrollbar
|
1999-10-12 04:16:06 +04:00
|
|
|
mInner->mHScrollbarFrame->GetNextSibling(&mInner->mVScrollbarFrame);
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
// listen for scroll events.
|
1999-11-24 09:03:41 +03:00
|
|
|
mInner->GetScrollableView(aPresContext)->AddScrollPositionListener(mInner);
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
return rv;
|
1999-08-20 02:16:23 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
1999-11-24 09:03:41 +03:00
|
|
|
nsGfxScrollFrame::AppendFrames(nsIPresContext* aPresContext,
|
1999-08-20 02:16:23 +04:00
|
|
|
nsIPresShell& aPresShell,
|
|
|
|
nsIAtom* aListName,
|
|
|
|
nsIFrame* aFrameList)
|
|
|
|
{
|
|
|
|
// Only one child frame allowed
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
1999-11-24 09:03:41 +03:00
|
|
|
nsGfxScrollFrame::InsertFrames(nsIPresContext* aPresContext,
|
1999-08-20 02:16:23 +04:00
|
|
|
nsIPresShell& aPresShell,
|
|
|
|
nsIAtom* aListName,
|
|
|
|
nsIFrame* aPrevFrame,
|
|
|
|
nsIFrame* aFrameList)
|
|
|
|
{
|
|
|
|
// Only one child frame allowed
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
1999-11-24 09:03:41 +03:00
|
|
|
nsGfxScrollFrame::RemoveFrame(nsIPresContext* aPresContext,
|
1999-08-20 02:16:23 +04:00
|
|
|
nsIPresShell& aPresShell,
|
|
|
|
nsIAtom* aListName,
|
|
|
|
nsIFrame* aOldFrame)
|
|
|
|
{
|
|
|
|
// Scroll frame doesn't support incremental changes
|
|
|
|
return NS_ERROR_NOT_IMPLEMENTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
1999-11-24 09:03:41 +03:00
|
|
|
nsGfxScrollFrame::DidReflow(nsIPresContext* aPresContext,
|
1999-08-20 02:16:23 +04:00
|
|
|
nsDidReflowStatus aStatus)
|
|
|
|
{
|
|
|
|
// Let the default nsFrame implementation clear the state flags
|
|
|
|
// and size and position our view
|
|
|
|
nsresult rv = nsHTMLContainerFrame::DidReflow(aPresContext, aStatus);
|
|
|
|
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
1999-11-24 09:03:41 +03:00
|
|
|
nsGfxScrollFrame::Reflow(nsIPresContext* aPresContext,
|
1999-08-20 02:16:23 +04:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsReflowStatus& aStatus)
|
|
|
|
{
|
|
|
|
NS_FRAME_TRACE_MSG(NS_FRAME_TRACE_CALLS,
|
|
|
|
("enter nsGfxScrollFrame::Reflow: maxSize=%d,%d",
|
|
|
|
aReflowState.availableWidth,
|
|
|
|
aReflowState.availableHeight));
|
|
|
|
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
// if we have any padding then ignore it. It is inherited down to our scrolled frame
|
|
|
|
if (aReflowState.mComputedPadding.left != 0 ||
|
|
|
|
aReflowState.mComputedPadding.right != 0 ||
|
|
|
|
aReflowState.mComputedPadding.top != 0 ||
|
|
|
|
aReflowState.mComputedPadding.bottom != 0)
|
|
|
|
{
|
|
|
|
nsHTMLReflowState newState(aReflowState);
|
1999-10-12 04:16:06 +04:00
|
|
|
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
// get the padding to remove
|
|
|
|
nscoord pwidth = (newState.mComputedPadding.left + newState.mComputedPadding.right);
|
|
|
|
nscoord pheight = (newState.mComputedPadding.top + newState.mComputedPadding.bottom);
|
|
|
|
|
|
|
|
// adjust our computed size to add in the padding we are removing. Make sure
|
|
|
|
// the computed size doesn't go negative or anything.
|
|
|
|
if (newState.mComputedWidth != NS_INTRINSICSIZE)
|
|
|
|
newState.mComputedWidth += pwidth;
|
1999-10-12 04:16:06 +04:00
|
|
|
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
if (newState.mComputedHeight != NS_INTRINSICSIZE)
|
|
|
|
newState.mComputedHeight += pheight;
|
1999-10-12 04:16:06 +04:00
|
|
|
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
// fix up the borderpadding
|
|
|
|
((nsMargin&)newState.mComputedBorderPadding) -= newState.mComputedPadding;
|
1999-10-12 04:16:06 +04:00
|
|
|
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
// remove the padding
|
|
|
|
((nsMargin&)newState.mComputedPadding) = nsMargin(0,0,0,0);
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
// reflow us again with the correct values.
|
|
|
|
return Reflow(aPresContext, aDesiredSize, newState, aStatus);
|
|
|
|
}
|
|
|
|
|
|
|
|
mInner->mFirstPass = PR_TRUE;
|
|
|
|
|
|
|
|
|
|
|
|
// Handle Incremental Reflow
|
1999-08-20 02:16:23 +04:00
|
|
|
nsIFrame* incrementalChild = nsnull;
|
|
|
|
|
2000-02-25 07:18:34 +03:00
|
|
|
/*
|
2000-02-11 00:36:28 +03:00
|
|
|
if (mInner->mNeverReflowed) {
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
// on the initial reflow see if we are the root box.
|
|
|
|
// the root box.
|
|
|
|
mInner->mIsRoot = PR_TRUE;
|
2000-02-11 00:36:28 +03:00
|
|
|
mInner->mNeverReflowed = PR_FALSE;
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
|
|
|
|
// see if we are the root box
|
|
|
|
nsIFrame* parent = mParent;
|
|
|
|
while (parent) {
|
|
|
|
nsIBox* ibox = nsnull;
|
|
|
|
if (NS_SUCCEEDED(parent->QueryInterface(nsIBox::GetIID(), (void**)&ibox)) && ibox) {
|
|
|
|
mInner->mIsRoot = PR_FALSE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
parent->GetParent(&parent);
|
|
|
|
}
|
2000-02-11 00:36:28 +03:00
|
|
|
}
|
2000-02-25 07:18:34 +03:00
|
|
|
*/
|
2000-02-11 00:36:28 +03:00
|
|
|
|
|
|
|
if ( aReflowState.reason == eReflowReason_Incremental ) {
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
|
|
|
|
nsIReflowCommand::ReflowType reflowType;
|
|
|
|
aReflowState.reflowCommand->GetType(reflowType);
|
|
|
|
|
|
|
|
// See if it's targeted at us
|
|
|
|
nsIFrame* targetFrame;
|
|
|
|
aReflowState.reflowCommand->GetTarget(targetFrame);
|
|
|
|
|
|
|
|
if (this == targetFrame) {
|
|
|
|
// if we are the target see what the type was
|
|
|
|
// and generate a normal non incremental reflow.
|
|
|
|
switch (reflowType) {
|
|
|
|
|
|
|
|
case nsIReflowCommand::StyleChanged:
|
|
|
|
{
|
|
|
|
nsHTMLReflowState newState(aReflowState);
|
|
|
|
newState.reason = eReflowReason_StyleChange;
|
2000-02-25 07:18:34 +03:00
|
|
|
newState.reflowCommand = nsnull;
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
return Reflow(aPresContext, aDesiredSize, newState, aStatus);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// if its a dirty type then reflow us with a dirty reflow
|
|
|
|
case nsIReflowCommand::ReflowDirty:
|
|
|
|
{
|
|
|
|
nsHTMLReflowState newState(aReflowState);
|
|
|
|
newState.reason = eReflowReason_Dirty;
|
2000-02-25 07:18:34 +03:00
|
|
|
newState.reflowCommand = nsnull;
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
return Reflow(aPresContext, aDesiredSize, newState, aStatus);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
NS_ASSERTION(PR_FALSE, "unexpected reflow command type");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-02-25 07:18:34 +03:00
|
|
|
/*
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
if (mInner->mIsRoot)
|
|
|
|
nsIBox::HandleRootBoxReflow(aPresContext, this, aReflowState);
|
|
|
|
|
|
|
|
// then get the child we need to flow incrementally
|
|
|
|
aReflowState.reflowCommand->GetNext(incrementalChild);
|
2000-02-25 07:18:34 +03:00
|
|
|
*/
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
1999-08-20 02:16:23 +04:00
|
|
|
|
|
|
|
// next reflow the scrollbars so we will at least know their size. If they are bigger or smaller than
|
|
|
|
// we thought we will have to reflow the scroll area as well.
|
1999-10-12 04:16:06 +04:00
|
|
|
mInner->ReflowScrollbars( aPresContext,
|
1999-08-20 02:16:23 +04:00
|
|
|
aReflowState,
|
|
|
|
aStatus,
|
|
|
|
incrementalChild);
|
|
|
|
|
|
|
|
// then reflow the scroll area. If it gets bigger it could signal the scrollbars need
|
|
|
|
// to be reflowed.
|
1999-10-12 04:16:06 +04:00
|
|
|
mInner->ReflowScrollArea( aPresContext,
|
1999-08-20 02:16:23 +04:00
|
|
|
aDesiredSize,
|
|
|
|
aReflowState,
|
|
|
|
aStatus,
|
|
|
|
incrementalChild);
|
|
|
|
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
mInner->mFirstPass = PR_FALSE;
|
|
|
|
|
1999-08-20 02:16:23 +04:00
|
|
|
// reflow the scrollbars again but only the ones that need it.
|
1999-10-12 04:16:06 +04:00
|
|
|
mInner->ReflowScrollbars( aPresContext,
|
1999-08-20 02:16:23 +04:00
|
|
|
aReflowState,
|
|
|
|
aStatus,
|
|
|
|
incrementalChild);
|
|
|
|
|
|
|
|
// layout all the children.
|
1999-10-12 04:16:06 +04:00
|
|
|
mInner->LayoutChildren( aPresContext,
|
1999-08-20 02:16:23 +04:00
|
|
|
aDesiredSize,
|
|
|
|
aReflowState);
|
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
if (aReflowState.mComputedWidth != NS_INTRINSICSIZE)
|
|
|
|
((nscoord&)aReflowState.mComputedWidth) -= (padding.left + padding.right);
|
|
|
|
|
|
|
|
if (aReflowState.mComputedHeight != NS_INTRINSICSIZE)
|
|
|
|
((nscoord&)aReflowState.mComputedHeight) -= (padding.top + padding.bottom);
|
|
|
|
|
|
|
|
((nsMargin&)aReflowState.mComputedPadding) = padding;
|
|
|
|
((nsMargin&)aReflowState.mComputedBorderPadding) += padding;
|
|
|
|
*/
|
|
|
|
|
1999-08-20 02:16:23 +04:00
|
|
|
NS_FRAME_TRACE_MSG(NS_FRAME_TRACE_CALLS,
|
|
|
|
("exit nsGfxScrollFrame::Reflow: status=%d width=%d height=%d",
|
|
|
|
aStatus, aDesiredSize.width, aDesiredSize.height));
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
/*
|
|
|
|
NS_IMETHODIMP
|
1999-11-24 09:03:41 +03:00
|
|
|
nsGfxScrollFrame::Paint(nsIPresContext* aPresContext,
|
1999-10-12 04:16:06 +04:00
|
|
|
nsIRenderingContext& aRenderingContext,
|
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
nsFramePaintLayer aWhichLayer)
|
|
|
|
{
|
|
|
|
|
|
|
|
if (NS_FRAME_PAINT_LAYER_BACKGROUND == aWhichLayer) {
|
|
|
|
// Only paint the border and background if we're visible
|
|
|
|
const nsStyleDisplay* display = (const nsStyleDisplay*)
|
|
|
|
mStyleContext->GetStyleData(eStyleStruct_Display);
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
if (display->mVisible) {
|
|
|
|
// Paint our border only (no background)
|
|
|
|
const nsStyleSpacing* spacing = (const nsStyleSpacing*)
|
|
|
|
mStyleContext->GetStyleData(eStyleStruct_Spacing);
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
nsRect rect(0, 0, mRect.width, mRect.height);
|
|
|
|
nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this,
|
|
|
|
aDirtyRect, rect, *spacing, mStyleContext, 0);
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
|
|
|
|
// paint the little square between the scrollbars
|
|
|
|
nsRect vbar;
|
|
|
|
nsRect hbar;
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
// get the child's rect
|
|
|
|
mVScrollbarFrame->GetRect(vbar);
|
|
|
|
mVScrollbarFrame->GetRect(hbar);
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
// get the margin
|
|
|
|
const nsStyleSpacing* s;
|
|
|
|
nsresult rv = mVScrollbarFrame->GetStyleData(eStyleStruct_Spacing,
|
|
|
|
(const nsStyleStruct*&) s);
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
nsMargin margin;
|
|
|
|
if (!s->GetMargin(margin))
|
|
|
|
margin.SizeTo(0,0,0,0);
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
vbar.Inflate(margin);
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
|
|
|
|
// get the margin
|
|
|
|
rv = mHScrollbarFrame->GetStyleData(eStyleStruct_Spacing,
|
|
|
|
(const nsStyleStruct*&) s);
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
if (!s->GetMargin(margin))
|
|
|
|
margin.SizeTo(0,0,0,0);
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
hbar.Inflate(margin);
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
rect.SetRect(hbar.x + hbar.width, vbar.y + vbar.height, vbar.width, hbar.height);
|
|
|
|
|
|
|
|
nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this,
|
|
|
|
aDirtyRect, rect, *myColor, *mySpacing, 0, 0);
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
}
|
|
|
|
} else {
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
// Paint our children
|
|
|
|
nsresult rv = nsHTMLContainerFrame::Paint(aPresContext, aRenderingContext, aDirtyRect,
|
|
|
|
aWhichLayer);
|
|
|
|
return rv;
|
|
|
|
}
|
1999-08-20 02:16:23 +04:00
|
|
|
}
|
1999-10-12 04:16:06 +04:00
|
|
|
*/
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
NS_IMETHODIMP
|
1999-11-24 09:03:41 +03:00
|
|
|
nsGfxScrollFrame::Paint(nsIPresContext* aPresContext,
|
1999-10-12 04:16:06 +04:00
|
|
|
nsIRenderingContext& aRenderingContext,
|
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
nsFramePaintLayer aWhichLayer)
|
1999-08-20 02:16:23 +04:00
|
|
|
{
|
1999-10-12 04:16:06 +04:00
|
|
|
/*
|
|
|
|
if (NS_FRAME_PAINT_LAYER_BACKGROUND == aWhichLayer) {
|
|
|
|
// Only paint the border and background if we're visible
|
|
|
|
const nsStyleDisplay* display = (const nsStyleDisplay*)
|
|
|
|
mStyleContext->GetStyleData(eStyleStruct_Display);
|
|
|
|
|
|
|
|
if (display->mVisible) {
|
|
|
|
// Paint our border only (no background)
|
|
|
|
const nsStyleSpacing* spacing = (const nsStyleSpacing*)
|
|
|
|
mStyleContext->GetStyleData(eStyleStruct_Spacing);
|
|
|
|
|
|
|
|
nsRect rect(0, 0, mRect.width, mRect.height);
|
|
|
|
nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this,
|
|
|
|
aDirtyRect, rect, *spacing, mStyleContext, 0);
|
|
|
|
nsCSSRendering::PaintOutline(aPresContext, aRenderingContext, this,
|
|
|
|
aDirtyRect, rect, *spacing, mStyleContext, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Paint our children
|
|
|
|
return nsHTMLContainerFrame::Paint(aPresContext, aRenderingContext, aDirtyRect,
|
|
|
|
aWhichLayer);
|
|
|
|
}
|
|
|
|
|
1999-11-18 22:40:52 +03:00
|
|
|
NS_IMETHODIMP
|
1999-11-24 09:03:41 +03:00
|
|
|
nsGfxScrollFrame::GetContentAndOffsetsFromPoint(nsIPresContext* aCX,
|
1999-11-18 22:40:52 +03:00
|
|
|
const nsPoint& aPoint,
|
|
|
|
nsIContent ** aNewContent,
|
|
|
|
PRInt32& aContentOffset,
|
|
|
|
PRInt32& aContentOffsetEnd,
|
|
|
|
PRBool& aBeginFrameContent)
|
|
|
|
{
|
|
|
|
if (! mInner)
|
|
|
|
return NS_ERROR_NULL_POINTER;
|
|
|
|
|
|
|
|
return mInner->mScrollAreaFrame->GetContentAndOffsetsFromPoint(aCX, aPoint, aNewContent, aContentOffset, aContentOffsetEnd, aBeginFrameContent);
|
|
|
|
}
|
1999-10-12 04:16:06 +04:00
|
|
|
|
|
|
|
PRIntn
|
|
|
|
nsGfxScrollFrame::GetSkipSides() const
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsGfxScrollFrame::GetFrameType(nsIAtom** aType) const
|
|
|
|
{
|
1999-12-14 01:56:31 +03:00
|
|
|
NS_PRECONDITION(nsnull != aType, "null OUT parameter pointer");
|
|
|
|
*aType = nsLayoutAtoms::scrollFrame;
|
|
|
|
NS_ADDREF(*aType);
|
|
|
|
return NS_OK;
|
1999-10-12 04:16:06 +04:00
|
|
|
}
|
|
|
|
|
1999-11-02 01:12:45 +03:00
|
|
|
#ifdef NS_DEBUG
|
1999-10-12 04:16:06 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsGfxScrollFrame::GetFrameName(nsString& aResult) const
|
|
|
|
{
|
|
|
|
return MakeFrameName("GfxScroll", aResult);
|
|
|
|
}
|
1999-11-02 01:12:45 +03:00
|
|
|
#endif
|
1999-10-12 04:16:06 +04:00
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsGfxScrollFrame::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
|
|
|
{
|
|
|
|
if (NULL == aInstancePtr) {
|
|
|
|
return NS_ERROR_NULL_POINTER;
|
|
|
|
}
|
|
|
|
|
|
|
|
*aInstancePtr = NULL;
|
|
|
|
|
|
|
|
if (aIID.Equals(kIAnonymousContentCreatorIID)) {
|
|
|
|
*aInstancePtr = (void*)(nsIAnonymousContentCreator*) this;
|
|
|
|
return NS_OK;
|
1999-12-21 22:28:15 +03:00
|
|
|
} else if (aIID.Equals(NS_GET_IID(nsIBox))) {
|
1999-10-12 04:16:06 +04:00
|
|
|
*aInstancePtr = (void*)(nsIBox*) this;
|
1999-12-07 06:36:05 +03:00
|
|
|
return NS_OK;
|
|
|
|
} else if (aIID.Equals(kIScrollableFrameIID)) {
|
|
|
|
*aInstancePtr = (void*)(nsIScrollableFrame*) this;
|
1999-10-12 04:16:06 +04:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
1999-12-07 06:36:05 +03:00
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
return nsHTMLContainerFrame::QueryInterface(aIID, aInstancePtr);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//-------------------- Inner ----------------------
|
|
|
|
|
|
|
|
nsGfxScrollFrameInner::nsGfxScrollFrameInner(nsGfxScrollFrame* aOuter):mHScrollbarFrame(nsnull),
|
|
|
|
mVScrollbarFrame(nsnull),
|
|
|
|
mScrollAreaFrame(nsnull),
|
2000-03-30 07:21:26 +04:00
|
|
|
mOnePixel(20),
|
1999-10-12 04:16:06 +04:00
|
|
|
mHasVerticalScrollbar(PR_FALSE),
|
2000-03-30 07:21:26 +04:00
|
|
|
mHasHorizontalScrollbar(PR_FALSE)
|
1999-10-12 04:16:06 +04:00
|
|
|
{
|
2000-03-06 00:26:01 +03:00
|
|
|
NS_INIT_REFCNT();
|
1999-10-12 04:16:06 +04:00
|
|
|
mOuter = aOuter;
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
mMaxElementSize.width = 0;
|
|
|
|
mMaxElementSize.height = 0;
|
|
|
|
mFirstPass = PR_FALSE;
|
1999-10-12 04:16:06 +04:00
|
|
|
}
|
|
|
|
|
1999-10-15 08:29:30 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsGfxScrollFrameInner::ScrollPositionWillChange(nsIScrollableView* aScrollable, nscoord aX, nscoord aY)
|
|
|
|
{
|
|
|
|
// Do nothing.
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
/**
|
|
|
|
* Called if something externally moves the scroll area
|
|
|
|
* This can happen if the user pages up down or uses arrow keys
|
|
|
|
* So what we need to do up adjust the scrollbars to match.
|
|
|
|
*/
|
|
|
|
NS_IMETHODIMP
|
1999-10-15 08:29:30 +04:00
|
|
|
nsGfxScrollFrameInner::ScrollPositionDidChange(nsIScrollableView* aScrollable, nscoord aX, nscoord aY)
|
1999-10-12 04:16:06 +04:00
|
|
|
{
|
|
|
|
SetAttribute(mVScrollbarFrame, nsXULAtoms::curpos, aY);
|
|
|
|
SetAttribute(mHScrollbarFrame, nsXULAtoms::curpos, aX);
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsGfxScrollFrameInner::AttributeChanged(nsIDocument *aDocument,
|
1999-10-26 08:44:41 +04:00
|
|
|
nsIContent* aContent,
|
|
|
|
PRInt32 aNameSpaceID,
|
|
|
|
nsIAtom* aAttribute,
|
|
|
|
PRInt32 aHint)
|
1999-10-12 04:16:06 +04:00
|
|
|
{
|
|
|
|
if (mHScrollbarFrame && mVScrollbarFrame)
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIContent> vcontent;
|
|
|
|
nsCOMPtr<nsIContent> hcontent;
|
|
|
|
|
|
|
|
mHScrollbarFrame->GetContent(getter_AddRefs(hcontent));
|
|
|
|
mVScrollbarFrame->GetContent(getter_AddRefs(vcontent));
|
|
|
|
|
|
|
|
if (hcontent.get() == aContent || vcontent.get() == aContent)
|
|
|
|
{
|
|
|
|
nscoord x = 0;
|
|
|
|
nscoord y = 0;
|
|
|
|
|
Landing changes Vidur made while the tree was closed for beta1 work, here's a list of the changes. r=me
[1] Cutting down the size of content. Made nsIJSScriptObject inherit from nsIScriptObjectOwner
[2] Cutting down the size of content. Made nsITextContent inherit from nsIContent.
[3] Cutting down the size of content. Moved implementation of nsIDOMReceiver to nsListenerManager. This is not true aggregation since it isn't transitive, but it's OK for now. It will be necessary for nsListenerManager to have a reference to its content in the future anyway, so the transitivity could be done.
dom/public/nsDOMPropEnums.h,v - bug 12559
dom/public/nsIJSScriptObject.h,v - [1]
dom/public/html/MANIFEST,v - bug 12559
dom/public/html/Makefile.in,v - bug 12559
dom/public/html/makefile.win,v - bug 12559
dom/public/html/nsIDOMHTMLInputElement.h,v - bug 17544
dom/public/idl/html/HTMLAnchorElement.idl,v - bug 12559
dom/public/idl/html/HTMLAreaElement.idl,v - bug 12559
dom/public/idl/html/HTMLInputElement.idl,v - bug 17544
dom/src/base/nsGlobalWindow.cpp,v - bug 30700
dom/src/base/nsGlobalWindow.h,v - [1]
dom/src/base/nsLocation.cpp,v - [1]
dom/src/html/nsJSHTMLAnchorElement.cpp,v - bug 12559
dom/src/html/nsJSHTMLAreaElement.cpp,v - bug 12559
dom/src/html/nsJSHTMLInputElement.cpp,v - bug 17544
layout/base/public/nsIDocument.h,v - bug 27953
layout/base/public/nsITextContent.h,v - [2]
layout/base/src/nsCommentNode.cpp,v - [2]
layout/base/src/nsDocument.cpp,v - bug 27953
layout/base/src/nsDocument.h,v - bug 27953
layout/base/src/nsDocumentViewer.cpp,v - bug 27953
layout/base/src/nsGenericDOMDataNode.cpp,v - [3]
layout/base/src/nsGenericDOMDataNode.h,v - [3]
layout/base/src/nsGenericElement.cpp,v - [3]
layout/base/src/nsGenericElement.h,v - [3]
layout/base/src/nsNameSpaceManager.cpp,v - bug 7834
layout/base/src/nsStyleContext.cpp,v - outline property shouldn't reflow
layout/base/src/nsTextNode.cpp,v - [2]
layout/events/src/nsEventListenerManager.cpp,v - [3]
layout/events/src/nsEventListenerManager.h,v - [3]
layout/html/base/src/nsGfxScrollFrame.cpp,v - nsString->nsAutoString
layout/html/content/src/nsAttributeContent.cpp,v - [2]
layout/html/content/src/nsHTMLAnchorElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLAppletElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLAreaElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBRElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBaseElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBaseFontElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBodyElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLButtonElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDListElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDelElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDirectoryElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDivElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLEmbedElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFieldSetElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFontElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFormElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFrameElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFrameSetElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHRElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHeadElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHeadingElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHtmlElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLIFrameElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLImageElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLInputElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLInsElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLIsIndexElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLIElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLabelElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLayerElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLegendElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLinkElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLMapElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLMenuElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLMetaElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLModElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLOListElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLObjectElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLOptGroupElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLOptionElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLParagraphElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLParamElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLPreElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLQuoteElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLScriptElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLSelectElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLSpacerElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLSpanElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLStyleElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableCaptionElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableCellElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableColElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableColGroupElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableRowElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableSectionElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTextAreaElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTitleElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLUListElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLWBRElement.cpp,v - [1][3]
layout/html/document/src/nsHTMLDocument.cpp,v - bug 27953
layout/html/document/src/nsHTMLDocument.h,v - bug 27953
layout/xml/content/src/nsXMLCDATASection.cpp,v - [1][2]
layout/xml/content/src/nsXMLDocumentType.cpp,v - [1][2]
layout/xml/content/src/nsXMLElement.h,v - [1][2]
layout/xml/content/src/nsXMLEntity.cpp,v - [1][2]
layout/xml/content/src/nsXMLNotation.cpp,v - [1][2]
layout/xml/content/src/nsXMLProcessingInstruction.cpp,v - [1][2]
layout/xul/base/src/nsBoxFrame.cpp,v - nsString->nsAutoString
layout/xul/base/src/nsSliderFrame.cpp,v - nsString->nsAutoString
netwerk/protocol/http/src/nsHTTPRequest.cpp,v - nsString->nsAutoString
rdf/content/src/nsXULDocument.cpp,v - bug 27953
rdf/content/src/nsXULDocument.h,v - bug 27953
rdf/content/src/nsXULElement.h,v - [1]
xpcom/base/IIDS.h,v - bug 12559
2000-03-17 16:27:00 +03:00
|
|
|
nsAutoString value;
|
1999-10-12 04:16:06 +04:00
|
|
|
if (NS_CONTENT_ATTR_HAS_VALUE == hcontent->GetAttribute(kNameSpaceID_None, nsXULAtoms::curpos, value))
|
|
|
|
{
|
|
|
|
PRInt32 error;
|
|
|
|
|
|
|
|
// convert it to an integer
|
|
|
|
x = value.ToInteger(&error);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (NS_CONTENT_ATTR_HAS_VALUE == vcontent->GetAttribute(kNameSpaceID_None, nsXULAtoms::curpos, value))
|
|
|
|
{
|
|
|
|
PRInt32 error;
|
|
|
|
|
|
|
|
// convert it to an integer
|
|
|
|
y = value.ToInteger(&error);
|
|
|
|
}
|
|
|
|
|
1999-10-26 08:44:41 +04:00
|
|
|
ScrollbarChanged(mOuter->mPresContext, x*mOnePixel, y*mOnePixel);
|
1999-10-12 04:16:06 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
nsIScrollableView*
|
1999-10-26 08:44:41 +04:00
|
|
|
nsGfxScrollFrameInner::GetScrollableView(nsIPresContext* aPresContext)
|
1999-10-12 04:16:06 +04:00
|
|
|
{
|
|
|
|
nsIScrollableView* scrollingView;
|
|
|
|
nsIView* view;
|
1999-10-26 08:44:41 +04:00
|
|
|
mScrollAreaFrame->GetView(aPresContext, &view);
|
1999-10-12 04:16:06 +04:00
|
|
|
nsresult result = view->QueryInterface(kScrollViewIID, (void**)&scrollingView);
|
|
|
|
NS_ASSERTION(NS_SUCCEEDED(result), "assertion gfx scrollframe does not contain a scrollframe");
|
|
|
|
return scrollingView;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2000-01-22 04:16:50 +03:00
|
|
|
nsGfxScrollFrameInner::GetScrolledContentSize(nsIPresContext* aPresContext, nsSize& aSize)
|
1999-10-12 04:16:06 +04:00
|
|
|
{
|
|
|
|
// get the ara frame is the scrollarea
|
|
|
|
nsIFrame* child = nsnull;
|
2000-01-22 04:16:50 +03:00
|
|
|
mScrollAreaFrame->FirstChild(aPresContext, nsnull, &child);
|
1999-10-12 04:16:06 +04:00
|
|
|
|
|
|
|
nsRect rect(0,0,0,0);
|
|
|
|
child->GetRect(rect);
|
|
|
|
aSize.width = rect.width;
|
|
|
|
aSize.height = rect.height;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
nsresult
|
1999-10-26 08:44:41 +04:00
|
|
|
nsGfxScrollFrameInner::SetFrameSize(nsIPresContext* aPresContext,
|
|
|
|
nsIFrame* aFrame,
|
|
|
|
nsSize aSize)
|
1999-10-12 04:16:06 +04:00
|
|
|
|
|
|
|
{
|
|
|
|
// get the margin
|
|
|
|
const nsStyleSpacing* spacing;
|
|
|
|
nsresult rv = aFrame->GetStyleData(eStyleStruct_Spacing,
|
|
|
|
(const nsStyleStruct*&) spacing);
|
|
|
|
|
1999-10-20 04:46:21 +04:00
|
|
|
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to get spacing");
|
|
|
|
if (NS_FAILED(rv))
|
|
|
|
return rv;
|
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
nsMargin margin;
|
|
|
|
if (!spacing->GetMargin(margin))
|
|
|
|
margin.SizeTo(0,0,0,0);
|
|
|
|
|
|
|
|
// add in the margin
|
|
|
|
aSize.width -= margin.left + margin.right;
|
|
|
|
aSize.height -= margin.top + margin.bottom;
|
|
|
|
|
1999-10-26 08:44:41 +04:00
|
|
|
aFrame->SizeTo(aPresContext, aSize.width, aSize.height);
|
1999-10-12 04:16:06 +04:00
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
nsGfxScrollFrameInner::GetFrameSize( nsIFrame* aFrame,
|
|
|
|
nsSize& aSize)
|
|
|
|
|
|
|
|
{
|
|
|
|
// get the child's rect
|
|
|
|
aFrame->GetSize(aSize);
|
|
|
|
|
|
|
|
// get the margin
|
|
|
|
const nsStyleSpacing* spacing;
|
|
|
|
nsresult rv = aFrame->GetStyleData(eStyleStruct_Spacing,
|
|
|
|
(const nsStyleStruct*&) spacing);
|
|
|
|
|
1999-10-20 04:46:21 +04:00
|
|
|
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to get spacing");
|
|
|
|
if (NS_FAILED(rv))
|
|
|
|
return rv;
|
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
nsMargin margin;
|
|
|
|
if (!spacing->GetMargin(margin))
|
|
|
|
margin.SizeTo(0,0,0,0);
|
|
|
|
|
|
|
|
// add in the margin
|
|
|
|
aSize.width += margin.left + margin.right;
|
|
|
|
aSize.height += margin.top + margin.bottom;
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Returns the width of the vertical scrollbar and the height of
|
|
|
|
// the horizontal scrollbar in twips
|
|
|
|
void
|
1999-11-24 09:03:41 +03:00
|
|
|
nsGfxScrollFrameInner::GetScrollbarDimensions(nsIPresContext* aPresContext,
|
1999-10-12 04:16:06 +04:00
|
|
|
nsSize& aSbSize)
|
|
|
|
{
|
|
|
|
|
|
|
|
// if we are using
|
|
|
|
nsRect rect(0,0,0,0);
|
|
|
|
mHScrollbarFrame->GetRect(rect);
|
|
|
|
aSbSize.height = rect.height;
|
|
|
|
|
|
|
|
rect.SetRect(0,0,0,0);
|
|
|
|
mVScrollbarFrame->GetRect(rect);
|
|
|
|
aSbSize.width = rect.width;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Calculates the size of the scroll area. This is the area inside of the
|
|
|
|
// border edge and inside of any vertical and horizontal scrollbar
|
|
|
|
// Also returns whether space was reserved for the vertical scrollbar.
|
|
|
|
nsresult
|
1999-11-24 09:03:41 +03:00
|
|
|
nsGfxScrollFrameInner::CalculateScrollAreaSize(nsIPresContext* aPresContext,
|
1999-10-12 04:16:06 +04:00
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
const nsSize& aSbSize,
|
|
|
|
nsSize& aScrollAreaSize)
|
|
|
|
{
|
|
|
|
aScrollAreaSize.width = aReflowState.mComputedWidth;
|
|
|
|
aScrollAreaSize.height = aReflowState.mComputedHeight;
|
|
|
|
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
if (aScrollAreaSize.width != NS_INTRINSICSIZE) {
|
|
|
|
aScrollAreaSize.width -= aReflowState.mComputedPadding.left + aReflowState.mComputedPadding.right;
|
|
|
|
if (aScrollAreaSize.width < 0)
|
|
|
|
aScrollAreaSize.width = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (aScrollAreaSize.height != NS_INTRINSICSIZE) {
|
|
|
|
aScrollAreaSize.height -= aReflowState.mComputedPadding.top + aReflowState.mComputedPadding.bottom;
|
|
|
|
if (aScrollAreaSize.height < 0)
|
|
|
|
aScrollAreaSize.height = 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
// get the current state
|
1999-08-20 02:16:23 +04:00
|
|
|
PRBool vert = mHasVerticalScrollbar;
|
|
|
|
PRBool horiz = mHasHorizontalScrollbar;
|
|
|
|
|
|
|
|
// reset everyting
|
|
|
|
mHasVerticalScrollbar = PR_FALSE;
|
|
|
|
mHasHorizontalScrollbar = PR_FALSE;
|
|
|
|
|
|
|
|
if (aReflowState.mStyleDisplay->mOverflow == NS_STYLE_OVERFLOW_SCROLL)
|
|
|
|
{
|
|
|
|
vert = PR_TRUE;
|
|
|
|
horiz = PR_TRUE;
|
|
|
|
}
|
2000-01-27 00:56:03 +03:00
|
|
|
else if (aReflowState.mStyleDisplay->mOverflow == NS_STYLE_OVERFLOW_SCROLLBARS_NONE)
|
|
|
|
{
|
|
|
|
vert = PR_FALSE;
|
|
|
|
horiz = PR_FALSE;
|
|
|
|
}
|
|
|
|
else if (aReflowState.mStyleDisplay->mOverflow == NS_STYLE_OVERFLOW_SCROLLBARS_VERTICAL)
|
|
|
|
{
|
|
|
|
vert = PR_TRUE;
|
|
|
|
horiz = PR_FALSE;
|
|
|
|
}
|
|
|
|
else if (aReflowState.mStyleDisplay->mOverflow == NS_STYLE_OVERFLOW_SCROLLBARS_HORIZONTAL)
|
|
|
|
{
|
|
|
|
vert = PR_FALSE;
|
|
|
|
horiz = PR_TRUE;
|
|
|
|
}
|
1999-08-20 02:16:23 +04:00
|
|
|
|
|
|
|
// add in the scrollbars.
|
|
|
|
if (horiz)
|
|
|
|
AddHorizontalScrollbar(aSbSize, aScrollAreaSize);
|
|
|
|
|
|
|
|
if (vert)
|
|
|
|
AddVerticalScrollbar(aSbSize, aScrollAreaSize);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Calculate the total amount of space needed for the child frame,
|
|
|
|
// including its child frames that stick outside its bounds and any
|
|
|
|
// absolutely positioned child frames.
|
|
|
|
// Updates the width/height members of the reflow metrics
|
|
|
|
nsresult
|
1999-10-12 04:16:06 +04:00
|
|
|
nsGfxScrollFrameInner::CalculateChildTotalSize(nsIFrame* aKidFrame,
|
1999-08-20 02:16:23 +04:00
|
|
|
nsHTMLReflowMetrics& aKidReflowMetrics)
|
|
|
|
{
|
|
|
|
// If the frame has child frames that stick outside its bounds, then take
|
|
|
|
// them into account, too
|
|
|
|
nsFrameState kidState;
|
|
|
|
aKidFrame->GetFrameState(&kidState);
|
|
|
|
if (NS_FRAME_OUTSIDE_CHILDREN & kidState) {
|
1999-12-06 18:49:53 +03:00
|
|
|
aKidReflowMetrics.width = aKidReflowMetrics.mOverflowArea.width;
|
|
|
|
aKidReflowMetrics.height = aKidReflowMetrics.mOverflowArea.height;
|
1999-08-20 02:16:23 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-10-12 04:16:06 +04:00
|
|
|
nsGfxScrollFrameInner::SetScrollbarVisibility(nsIFrame* aScrollbar, PRBool aVisible)
|
1999-08-20 02:16:23 +04:00
|
|
|
{
|
Landing changes Vidur made while the tree was closed for beta1 work, here's a list of the changes. r=me
[1] Cutting down the size of content. Made nsIJSScriptObject inherit from nsIScriptObjectOwner
[2] Cutting down the size of content. Made nsITextContent inherit from nsIContent.
[3] Cutting down the size of content. Moved implementation of nsIDOMReceiver to nsListenerManager. This is not true aggregation since it isn't transitive, but it's OK for now. It will be necessary for nsListenerManager to have a reference to its content in the future anyway, so the transitivity could be done.
dom/public/nsDOMPropEnums.h,v - bug 12559
dom/public/nsIJSScriptObject.h,v - [1]
dom/public/html/MANIFEST,v - bug 12559
dom/public/html/Makefile.in,v - bug 12559
dom/public/html/makefile.win,v - bug 12559
dom/public/html/nsIDOMHTMLInputElement.h,v - bug 17544
dom/public/idl/html/HTMLAnchorElement.idl,v - bug 12559
dom/public/idl/html/HTMLAreaElement.idl,v - bug 12559
dom/public/idl/html/HTMLInputElement.idl,v - bug 17544
dom/src/base/nsGlobalWindow.cpp,v - bug 30700
dom/src/base/nsGlobalWindow.h,v - [1]
dom/src/base/nsLocation.cpp,v - [1]
dom/src/html/nsJSHTMLAnchorElement.cpp,v - bug 12559
dom/src/html/nsJSHTMLAreaElement.cpp,v - bug 12559
dom/src/html/nsJSHTMLInputElement.cpp,v - bug 17544
layout/base/public/nsIDocument.h,v - bug 27953
layout/base/public/nsITextContent.h,v - [2]
layout/base/src/nsCommentNode.cpp,v - [2]
layout/base/src/nsDocument.cpp,v - bug 27953
layout/base/src/nsDocument.h,v - bug 27953
layout/base/src/nsDocumentViewer.cpp,v - bug 27953
layout/base/src/nsGenericDOMDataNode.cpp,v - [3]
layout/base/src/nsGenericDOMDataNode.h,v - [3]
layout/base/src/nsGenericElement.cpp,v - [3]
layout/base/src/nsGenericElement.h,v - [3]
layout/base/src/nsNameSpaceManager.cpp,v - bug 7834
layout/base/src/nsStyleContext.cpp,v - outline property shouldn't reflow
layout/base/src/nsTextNode.cpp,v - [2]
layout/events/src/nsEventListenerManager.cpp,v - [3]
layout/events/src/nsEventListenerManager.h,v - [3]
layout/html/base/src/nsGfxScrollFrame.cpp,v - nsString->nsAutoString
layout/html/content/src/nsAttributeContent.cpp,v - [2]
layout/html/content/src/nsHTMLAnchorElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLAppletElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLAreaElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBRElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBaseElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBaseFontElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBodyElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLButtonElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDListElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDelElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDirectoryElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDivElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLEmbedElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFieldSetElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFontElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFormElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFrameElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFrameSetElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHRElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHeadElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHeadingElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHtmlElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLIFrameElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLImageElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLInputElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLInsElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLIsIndexElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLIElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLabelElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLayerElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLegendElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLinkElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLMapElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLMenuElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLMetaElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLModElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLOListElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLObjectElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLOptGroupElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLOptionElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLParagraphElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLParamElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLPreElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLQuoteElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLScriptElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLSelectElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLSpacerElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLSpanElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLStyleElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableCaptionElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableCellElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableColElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableColGroupElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableRowElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableSectionElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTextAreaElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTitleElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLUListElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLWBRElement.cpp,v - [1][3]
layout/html/document/src/nsHTMLDocument.cpp,v - bug 27953
layout/html/document/src/nsHTMLDocument.h,v - bug 27953
layout/xml/content/src/nsXMLCDATASection.cpp,v - [1][2]
layout/xml/content/src/nsXMLDocumentType.cpp,v - [1][2]
layout/xml/content/src/nsXMLElement.h,v - [1][2]
layout/xml/content/src/nsXMLEntity.cpp,v - [1][2]
layout/xml/content/src/nsXMLNotation.cpp,v - [1][2]
layout/xml/content/src/nsXMLProcessingInstruction.cpp,v - [1][2]
layout/xul/base/src/nsBoxFrame.cpp,v - nsString->nsAutoString
layout/xul/base/src/nsSliderFrame.cpp,v - nsString->nsAutoString
netwerk/protocol/http/src/nsHTTPRequest.cpp,v - nsString->nsAutoString
rdf/content/src/nsXULDocument.cpp,v - bug 27953
rdf/content/src/nsXULDocument.h,v - bug 27953
rdf/content/src/nsXULElement.h,v - [1]
xpcom/base/IIDS.h,v - bug 12559
2000-03-17 16:27:00 +03:00
|
|
|
nsAutoString oldStyle = "";
|
1999-08-20 02:16:23 +04:00
|
|
|
nsCOMPtr<nsIContent> child;
|
|
|
|
aScrollbar->GetContent(getter_AddRefs(child));
|
|
|
|
child->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::value, oldStyle);
|
|
|
|
|
Landing changes Vidur made while the tree was closed for beta1 work, here's a list of the changes. r=me
[1] Cutting down the size of content. Made nsIJSScriptObject inherit from nsIScriptObjectOwner
[2] Cutting down the size of content. Made nsITextContent inherit from nsIContent.
[3] Cutting down the size of content. Moved implementation of nsIDOMReceiver to nsListenerManager. This is not true aggregation since it isn't transitive, but it's OK for now. It will be necessary for nsListenerManager to have a reference to its content in the future anyway, so the transitivity could be done.
dom/public/nsDOMPropEnums.h,v - bug 12559
dom/public/nsIJSScriptObject.h,v - [1]
dom/public/html/MANIFEST,v - bug 12559
dom/public/html/Makefile.in,v - bug 12559
dom/public/html/makefile.win,v - bug 12559
dom/public/html/nsIDOMHTMLInputElement.h,v - bug 17544
dom/public/idl/html/HTMLAnchorElement.idl,v - bug 12559
dom/public/idl/html/HTMLAreaElement.idl,v - bug 12559
dom/public/idl/html/HTMLInputElement.idl,v - bug 17544
dom/src/base/nsGlobalWindow.cpp,v - bug 30700
dom/src/base/nsGlobalWindow.h,v - [1]
dom/src/base/nsLocation.cpp,v - [1]
dom/src/html/nsJSHTMLAnchorElement.cpp,v - bug 12559
dom/src/html/nsJSHTMLAreaElement.cpp,v - bug 12559
dom/src/html/nsJSHTMLInputElement.cpp,v - bug 17544
layout/base/public/nsIDocument.h,v - bug 27953
layout/base/public/nsITextContent.h,v - [2]
layout/base/src/nsCommentNode.cpp,v - [2]
layout/base/src/nsDocument.cpp,v - bug 27953
layout/base/src/nsDocument.h,v - bug 27953
layout/base/src/nsDocumentViewer.cpp,v - bug 27953
layout/base/src/nsGenericDOMDataNode.cpp,v - [3]
layout/base/src/nsGenericDOMDataNode.h,v - [3]
layout/base/src/nsGenericElement.cpp,v - [3]
layout/base/src/nsGenericElement.h,v - [3]
layout/base/src/nsNameSpaceManager.cpp,v - bug 7834
layout/base/src/nsStyleContext.cpp,v - outline property shouldn't reflow
layout/base/src/nsTextNode.cpp,v - [2]
layout/events/src/nsEventListenerManager.cpp,v - [3]
layout/events/src/nsEventListenerManager.h,v - [3]
layout/html/base/src/nsGfxScrollFrame.cpp,v - nsString->nsAutoString
layout/html/content/src/nsAttributeContent.cpp,v - [2]
layout/html/content/src/nsHTMLAnchorElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLAppletElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLAreaElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBRElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBaseElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBaseFontElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBodyElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLButtonElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDListElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDelElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDirectoryElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDivElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLEmbedElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFieldSetElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFontElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFormElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFrameElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFrameSetElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHRElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHeadElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHeadingElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHtmlElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLIFrameElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLImageElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLInputElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLInsElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLIsIndexElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLIElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLabelElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLayerElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLegendElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLinkElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLMapElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLMenuElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLMetaElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLModElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLOListElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLObjectElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLOptGroupElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLOptionElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLParagraphElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLParamElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLPreElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLQuoteElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLScriptElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLSelectElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLSpacerElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLSpanElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLStyleElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableCaptionElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableCellElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableColElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableColGroupElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableRowElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableSectionElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTextAreaElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTitleElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLUListElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLWBRElement.cpp,v - [1][3]
layout/html/document/src/nsHTMLDocument.cpp,v - bug 27953
layout/html/document/src/nsHTMLDocument.h,v - bug 27953
layout/xml/content/src/nsXMLCDATASection.cpp,v - [1][2]
layout/xml/content/src/nsXMLDocumentType.cpp,v - [1][2]
layout/xml/content/src/nsXMLElement.h,v - [1][2]
layout/xml/content/src/nsXMLEntity.cpp,v - [1][2]
layout/xml/content/src/nsXMLNotation.cpp,v - [1][2]
layout/xml/content/src/nsXMLProcessingInstruction.cpp,v - [1][2]
layout/xul/base/src/nsBoxFrame.cpp,v - nsString->nsAutoString
layout/xul/base/src/nsSliderFrame.cpp,v - nsString->nsAutoString
netwerk/protocol/http/src/nsHTTPRequest.cpp,v - nsString->nsAutoString
rdf/content/src/nsXULDocument.cpp,v - bug 27953
rdf/content/src/nsXULDocument.h,v - bug 27953
rdf/content/src/nsXULElement.h,v - [1]
xpcom/base/IIDS.h,v - bug 12559
2000-03-17 16:27:00 +03:00
|
|
|
nsAutoString newStyle;
|
1999-08-20 02:16:23 +04:00
|
|
|
if (aVisible)
|
|
|
|
newStyle = "";
|
|
|
|
else
|
|
|
|
newStyle = "hidden";
|
|
|
|
|
|
|
|
if (oldStyle != newStyle)
|
|
|
|
child->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::value, newStyle, PR_TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reflows the visible scrollbars to fit in our content area. If the scrollbars change size
|
|
|
|
* Signal that the content area needs to be reflowed to accomidate the new size. This can
|
|
|
|
* happend if a css rule like :hover causes the scrollbar to get bigger.
|
|
|
|
*/
|
|
|
|
void
|
1999-11-24 09:03:41 +03:00
|
|
|
nsGfxScrollFrameInner::ReflowScrollbars( nsIPresContext* aPresContext,
|
1999-08-20 02:16:23 +04:00
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsReflowStatus& aStatus,
|
|
|
|
nsIFrame*& aIncrementalChild)
|
|
|
|
{
|
|
|
|
// if we have gfx scrollbars reflow them. If they changed size then signal that
|
|
|
|
// we need to reflow the content area. This could happen if there is a style rule set
|
|
|
|
// up on them that changed there size. Like an image on the thumb gets big.
|
|
|
|
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
PRBool resized = PR_TRUE;
|
|
|
|
if (mHasHorizontalScrollbar || aReflowState.reason == eReflowReason_Initial) {
|
|
|
|
ReflowScrollbar(aPresContext,
|
|
|
|
aReflowState,
|
|
|
|
aStatus,
|
|
|
|
resized,
|
|
|
|
mHScrollbarFrame,
|
|
|
|
aIncrementalChild);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mHasVerticalScrollbar || aReflowState.reason == eReflowReason_Initial) {
|
|
|
|
ReflowScrollbar(aPresContext,
|
|
|
|
aReflowState,
|
|
|
|
aStatus,
|
|
|
|
resized,
|
|
|
|
mVScrollbarFrame,
|
|
|
|
aIncrementalChild);
|
|
|
|
}
|
1999-08-20 02:16:23 +04:00
|
|
|
|
|
|
|
SetScrollbarVisibility(mHScrollbarFrame, mHasHorizontalScrollbar);
|
|
|
|
SetScrollbarVisibility(mVScrollbarFrame, mHasVerticalScrollbar);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-11-24 09:03:41 +03:00
|
|
|
nsGfxScrollFrameInner::ReflowScrollbar( nsIPresContext* aPresContext,
|
1999-08-20 02:16:23 +04:00
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsReflowStatus& aStatus,
|
|
|
|
PRBool& aScrollbarResized,
|
|
|
|
nsIFrame* aScrollbarFrame,
|
|
|
|
nsIFrame*& aIncrementalChild)
|
|
|
|
{
|
|
|
|
nsSize scrollArea;
|
|
|
|
GetFrameSize(mScrollAreaFrame, scrollArea);
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
|
|
|
|
// add the padding to it.
|
|
|
|
scrollArea.width += aReflowState.mComputedPadding.left + aReflowState.mComputedPadding.right;
|
|
|
|
scrollArea.height += aReflowState.mComputedPadding.top + aReflowState.mComputedPadding.bottom;
|
|
|
|
|
1999-08-20 02:16:23 +04:00
|
|
|
// is it the horizontal scrollbar?
|
|
|
|
if (aScrollbarFrame == mHScrollbarFrame) {
|
|
|
|
|
|
|
|
// get the width to layout in
|
|
|
|
nscoord width = scrollArea.width;
|
|
|
|
|
|
|
|
nsHTMLReflowMetrics desiredSize(nsnull);
|
|
|
|
|
|
|
|
// reflow the frame
|
|
|
|
ReflowFrame(aPresContext, desiredSize, aReflowState, aStatus, mHScrollbarFrame,
|
|
|
|
nsSize(NS_INTRINSICSIZE, NS_INTRINSICSIZE),
|
|
|
|
nsSize(width, NS_INTRINSICSIZE),
|
|
|
|
aScrollbarResized,
|
|
|
|
aIncrementalChild);
|
|
|
|
|
|
|
|
} else if (aScrollbarFrame == mVScrollbarFrame) {
|
|
|
|
// is it the vertical scrollbar?
|
|
|
|
|
|
|
|
// get the height to layout in
|
|
|
|
nscoord height = scrollArea.height;
|
|
|
|
|
|
|
|
nsHTMLReflowMetrics desiredSize(nsnull);
|
|
|
|
|
|
|
|
// reflow the frame
|
|
|
|
ReflowFrame(aPresContext, desiredSize, aReflowState, aStatus, mVScrollbarFrame,
|
|
|
|
nsSize(NS_INTRINSICSIZE, NS_INTRINSICSIZE),
|
|
|
|
nsSize(NS_INTRINSICSIZE, height),
|
|
|
|
aScrollbarResized,
|
|
|
|
aIncrementalChild);
|
|
|
|
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
}
|
1999-08-20 02:16:23 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-10-12 04:16:06 +04:00
|
|
|
nsGfxScrollFrameInner::AddRemoveScrollbar(PRBool& aHasScrollbar, nscoord& aSize, nscoord aSbSize, PRBool aAdd)
|
1999-08-20 02:16:23 +04:00
|
|
|
{
|
|
|
|
if ((aAdd && aHasScrollbar) || (!aAdd && !aHasScrollbar))
|
|
|
|
return;
|
1999-10-12 04:16:06 +04:00
|
|
|
|
|
|
|
nscoord size = aSize;
|
|
|
|
|
|
|
|
if (size != NS_INTRINSICSIZE) {
|
1999-08-20 02:16:23 +04:00
|
|
|
if (aAdd)
|
1999-10-12 04:16:06 +04:00
|
|
|
size -= aSbSize;
|
1999-08-20 02:16:23 +04:00
|
|
|
else
|
1999-10-12 04:16:06 +04:00
|
|
|
size += aSbSize;
|
|
|
|
}
|
|
|
|
|
|
|
|
// not enough room? If not don't do anything.
|
|
|
|
if (size >= aSbSize) {
|
|
|
|
aHasScrollbar = aAdd;
|
|
|
|
aSize = size;
|
1999-08-20 02:16:23 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-10-12 04:16:06 +04:00
|
|
|
nsGfxScrollFrameInner::AddHorizontalScrollbar(const nsSize& aSbSize, nsSize& aScrollAreaSize)
|
1999-08-20 02:16:23 +04:00
|
|
|
{
|
|
|
|
AddRemoveScrollbar(mHasHorizontalScrollbar, aScrollAreaSize.height, aSbSize.height, PR_TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-10-12 04:16:06 +04:00
|
|
|
nsGfxScrollFrameInner::AddVerticalScrollbar(const nsSize& aSbSize, nsSize& aScrollAreaSize)
|
1999-08-20 02:16:23 +04:00
|
|
|
{
|
|
|
|
AddRemoveScrollbar(mHasVerticalScrollbar, aScrollAreaSize.width, aSbSize.width, PR_TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-10-12 04:16:06 +04:00
|
|
|
nsGfxScrollFrameInner::RemoveHorizontalScrollbar(const nsSize& aSbSize, nsSize& aScrollAreaSize)
|
1999-08-20 02:16:23 +04:00
|
|
|
{
|
|
|
|
AddRemoveScrollbar(mHasHorizontalScrollbar, aScrollAreaSize.height, aSbSize.height, PR_FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-10-12 04:16:06 +04:00
|
|
|
nsGfxScrollFrameInner::RemoveVerticalScrollbar(const nsSize& aSbSize, nsSize& aScrollAreaSize)
|
1999-08-20 02:16:23 +04:00
|
|
|
{
|
|
|
|
AddRemoveScrollbar(mHasVerticalScrollbar, aScrollAreaSize.width, aSbSize.width, PR_FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Give a computed and available sizes flows the child at that size.
|
|
|
|
* This is special because it takes into account margin and borderpadding.
|
|
|
|
* It also tells us if the child changed size or not.
|
|
|
|
* And finally it will handle the incremental reflow for us. If it reflowed the
|
|
|
|
* incrementalChild it will set it to nsnull
|
|
|
|
*/
|
|
|
|
nsresult
|
1999-11-24 09:03:41 +03:00
|
|
|
nsGfxScrollFrameInner::ReflowFrame( nsIPresContext* aPresContext,
|
1999-08-20 02:16:23 +04:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsReflowStatus& aStatus,
|
|
|
|
nsIFrame* aFrame,
|
|
|
|
const nsSize& aAvailable,
|
|
|
|
const nsSize& aComputed,
|
|
|
|
PRBool& aResized,
|
|
|
|
nsIFrame*& aIncrementalChild)
|
|
|
|
{
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
PRBool needsReflow = PR_FALSE;
|
|
|
|
nsReflowReason reason = aReflowState.reason;
|
|
|
|
|
2000-02-25 07:18:34 +03:00
|
|
|
nsFrameState childState;
|
|
|
|
aFrame->GetFrameState(&childState);
|
|
|
|
|
|
|
|
if (childState & NS_FRAME_FIRST_REFLOW) {
|
|
|
|
if (reason != eReflowReason_Initial)
|
|
|
|
{
|
|
|
|
// if incremental then make sure we send a initial reflow first.
|
|
|
|
if (reason == eReflowReason_Incremental) {
|
|
|
|
nsHTMLReflowState state(aReflowState);
|
|
|
|
state.reason = eReflowReason_Initial;
|
|
|
|
state.reflowCommand = nsnull;
|
|
|
|
ReflowFrame( aPresContext, aDesiredSize, state, aStatus, aFrame, aAvailable, aComputed, aResized, aIncrementalChild);
|
|
|
|
} else {
|
|
|
|
// convert to initial if not incremental.
|
|
|
|
reason = eReflowReason_Initial;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
} else if (reason == eReflowReason_Initial) {
|
|
|
|
reason = eReflowReason_Resize;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
switch(reason)
|
|
|
|
{
|
2000-02-25 07:18:34 +03:00
|
|
|
case eReflowReason_Incremental: {
|
|
|
|
// if incremental see if the next child in the chain is the child. If so then
|
|
|
|
// we will just let it go down. If not then convert it to a dirty. It will get picked
|
|
|
|
// up later.
|
|
|
|
nsIFrame* incrementalChild = nsnull;
|
|
|
|
aReflowState.reflowCommand->GetNext(incrementalChild, PR_FALSE);
|
|
|
|
if (incrementalChild == aFrame) {
|
|
|
|
needsReflow = PR_TRUE;
|
|
|
|
aReflowState.reflowCommand->GetNext(incrementalChild);
|
|
|
|
} else {
|
|
|
|
nsHTMLReflowState state(aReflowState);
|
|
|
|
state.reason = eReflowReason_Dirty;
|
|
|
|
return ReflowFrame( aPresContext, aDesiredSize, state, aStatus, aFrame, aAvailable, aComputed, aResized, aIncrementalChild);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
if (aIncrementalChild == aFrame) {
|
|
|
|
needsReflow = PR_TRUE;
|
|
|
|
aIncrementalChild = nsnull;
|
|
|
|
} else {
|
|
|
|
reason = eReflowReason_Resize;
|
|
|
|
needsReflow = PR_FALSE;
|
|
|
|
}
|
2000-02-25 07:18:34 +03:00
|
|
|
*/
|
|
|
|
} break;
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
|
|
|
|
// if its dirty then see if the child we want to reflow is dirty. If it is then
|
|
|
|
// mark it as needing to be reflowed.
|
2000-02-25 07:18:34 +03:00
|
|
|
case eReflowReason_Dirty: {
|
|
|
|
|
|
|
|
// so look at the next child. If it is use convert back to incremental.
|
|
|
|
if (aReflowState.reflowCommand) {
|
|
|
|
nsIFrame* incrementalChild = nsnull;
|
|
|
|
aReflowState.reflowCommand->GetNext(incrementalChild, PR_FALSE);
|
|
|
|
if (incrementalChild == aFrame) {
|
|
|
|
nsHTMLReflowState state(aReflowState);
|
|
|
|
state.reason = eReflowReason_Incremental;
|
|
|
|
return ReflowFrame( aPresContext, aDesiredSize, state, aStatus, aFrame, aAvailable, aComputed, aResized, aIncrementalChild);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
// get the frame state to see if it needs reflow
|
2000-02-25 07:18:34 +03:00
|
|
|
needsReflow = (childState & NS_FRAME_IS_DIRTY) || (childState & NS_FRAME_HAS_DIRTY_CHILDREN);
|
|
|
|
|
|
|
|
} break;
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
|
|
|
|
// if the a resize reflow then it doesn't need to be reflowed. Only if the size is different
|
|
|
|
// from the new size would we actually do a reflow
|
|
|
|
case eReflowReason_Resize:
|
|
|
|
needsReflow = PR_FALSE;
|
|
|
|
break;
|
|
|
|
|
2000-02-25 07:18:34 +03:00
|
|
|
case eReflowReason_Initial:
|
|
|
|
needsReflow = PR_TRUE;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
default:
|
|
|
|
needsReflow = PR_TRUE;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
nsSize currentSize;
|
|
|
|
GetFrameSize(aFrame, currentSize);
|
|
|
|
|
|
|
|
// if we do not need reflow then
|
|
|
|
// see if the size it what we already want. If it is then we are done.
|
|
|
|
if (!needsReflow) {
|
|
|
|
// get the current size
|
|
|
|
|
|
|
|
// if the size is not changing and the frame is not dirty then there
|
|
|
|
// is nothing to do.
|
|
|
|
if (currentSize.width == aComputed.width && currentSize.height == aComputed.height) {
|
|
|
|
aDesiredSize.width = currentSize.width;
|
|
|
|
aDesiredSize.height = currentSize.height;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
}
|
1999-08-20 02:16:23 +04:00
|
|
|
|
|
|
|
aDesiredSize.width = 0;
|
|
|
|
aDesiredSize.height = 0;
|
|
|
|
|
|
|
|
nsHTMLReflowState childReflowState(aPresContext, aReflowState,
|
|
|
|
aFrame, aAvailable);
|
|
|
|
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
childReflowState.reason = reason;
|
1999-08-20 02:16:23 +04:00
|
|
|
childReflowState.mComputedWidth = aComputed.width;
|
|
|
|
childReflowState.mComputedHeight = aComputed.height;
|
|
|
|
|
|
|
|
// subtract out the childs margin and border if computed
|
|
|
|
const nsStyleSpacing* spacing;
|
|
|
|
nsresult rv = aFrame->GetStyleData(eStyleStruct_Spacing,
|
|
|
|
(const nsStyleStruct*&) spacing);
|
|
|
|
|
1999-10-20 04:46:21 +04:00
|
|
|
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to get spacing");
|
|
|
|
if (NS_FAILED(rv))
|
|
|
|
return rv;
|
|
|
|
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
// get the margin
|
1999-10-12 04:16:06 +04:00
|
|
|
nsMargin margin(0,0,0,0);
|
|
|
|
spacing->GetMargin(margin);
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
|
|
|
|
// subtract out the border and padding
|
|
|
|
if (childReflowState.mComputedWidth != NS_INTRINSICSIZE) {
|
1999-10-12 04:16:06 +04:00
|
|
|
childReflowState.mComputedWidth -= childReflowState.mComputedBorderPadding.left + childReflowState.mComputedBorderPadding.right;
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
childReflowState.mComputedWidth -= margin.left + margin.right;
|
|
|
|
if (childReflowState.mComputedWidth < 0)
|
|
|
|
childReflowState.mComputedWidth = 0;
|
|
|
|
}
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
if (childReflowState.mComputedHeight != NS_INTRINSICSIZE) {
|
1999-10-12 04:16:06 +04:00
|
|
|
childReflowState.mComputedHeight -= childReflowState.mComputedBorderPadding.top + childReflowState.mComputedBorderPadding.bottom;
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
childReflowState.mComputedWidth -= margin.top + margin.bottom;
|
|
|
|
if (childReflowState.mComputedHeight < 0)
|
|
|
|
childReflowState.mComputedHeight = 0;
|
|
|
|
}
|
1999-10-12 04:16:06 +04:00
|
|
|
|
1999-11-19 18:33:29 +03:00
|
|
|
mOuter->ReflowChild(aFrame, aPresContext, aDesiredSize, childReflowState,
|
|
|
|
0, 0, NS_FRAME_NO_MOVE_FRAME, aStatus);
|
1999-08-20 02:16:23 +04:00
|
|
|
NS_ASSERTION(NS_FRAME_IS_COMPLETE(aStatus), "bad status");
|
|
|
|
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
NS_ASSERTION(aDesiredSize.width >= 0 && aDesiredSize.height >= 0,"Error child's size is less than 0!");
|
|
|
|
|
1999-08-20 02:16:23 +04:00
|
|
|
// if the frame size change then mark the flag
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
if (currentSize.width != aDesiredSize.width || currentSize.height != aDesiredSize.height) {
|
1999-11-24 09:03:41 +03:00
|
|
|
aFrame->SizeTo(aPresContext, aDesiredSize.width, aDesiredSize.height);
|
1999-08-20 02:16:23 +04:00
|
|
|
aResized = PR_TRUE;
|
|
|
|
}
|
1999-11-19 18:33:29 +03:00
|
|
|
aFrame->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED);
|
1999-08-20 02:16:23 +04:00
|
|
|
|
|
|
|
// add the margin back in
|
|
|
|
aDesiredSize.width += margin.left + margin.right;
|
|
|
|
aDesiredSize.height += margin.top + margin.bottom;
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* Reflow the scroll area if it needs it and return its size. Also determine if the reflow will
|
|
|
|
* cause any of the scrollbars to need to be reflowed.
|
|
|
|
*/
|
|
|
|
void
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
nsGfxScrollFrameInner::ReflowScrollArea( nsIPresContext* aPresContext,
|
1999-08-20 02:16:23 +04:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsReflowStatus& aStatus,
|
|
|
|
nsIFrame*& aIncrementalChild)
|
|
|
|
{
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
nsSize scrollAreaSize;
|
1999-08-20 02:16:23 +04:00
|
|
|
|
|
|
|
// get the current scrollarea size
|
|
|
|
nsSize oldScrollAreaSize;
|
1999-10-20 04:46:21 +04:00
|
|
|
|
1999-08-20 02:16:23 +04:00
|
|
|
GetFrameSize(mScrollAreaFrame, oldScrollAreaSize);
|
|
|
|
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
/*
|
|
|
|
// add our padding
|
|
|
|
oldScrollAreaSize.width += aReflowState.mComputedPadding.left + aReflowState.mComputedPadding.right;
|
|
|
|
oldScrollAreaSize.height += aReflowState.mComputedPadding.top + aReflowState.mComputedPadding.bottom;
|
|
|
|
*/
|
|
|
|
|
1999-08-20 02:16:23 +04:00
|
|
|
// get the width of the vertical scrollbar and the height of the horizontal scrollbar
|
|
|
|
nsSize sbSize;
|
|
|
|
GetScrollbarDimensions(aPresContext, sbSize);
|
|
|
|
|
|
|
|
// Compute the scroll area size (area inside of the border edge and inside
|
|
|
|
// of any vertical and horizontal scrollbars)
|
|
|
|
nsHTMLReflowMetrics scrollAreaDesiredSize(aDesiredSize.maxElementSize);
|
|
|
|
|
|
|
|
CalculateScrollAreaSize(aPresContext, aReflowState, sbSize,
|
|
|
|
scrollAreaSize);
|
|
|
|
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
// if the frame is not changing size and its not dirty then do nothing
|
|
|
|
//if (oldScrollAreaSize == scrollAreaSize && !IsDirty(mScrollAreaFrame))
|
|
|
|
// return;
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1999-08-27 10:06:39 +04:00
|
|
|
// -------- flow the scroll area -----------
|
1999-08-20 02:16:23 +04:00
|
|
|
nsSize scrollAreaReflowSize(scrollAreaSize.width, scrollAreaSize.height);
|
|
|
|
|
|
|
|
PRBool resized = PR_FALSE;
|
|
|
|
ReflowFrame(aPresContext, scrollAreaDesiredSize, aReflowState, aStatus, mScrollAreaFrame,
|
|
|
|
scrollAreaReflowSize,
|
|
|
|
scrollAreaReflowSize,
|
|
|
|
resized,
|
|
|
|
aIncrementalChild);
|
|
|
|
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
// ------- set up max size -------
|
|
|
|
if (nsnull != aDesiredSize.maxElementSize) {
|
|
|
|
*aDesiredSize.maxElementSize = *scrollAreaDesiredSize.maxElementSize;
|
|
|
|
mMaxElementSize = *aDesiredSize.maxElementSize;
|
|
|
|
}
|
|
|
|
|
1999-08-20 02:16:23 +04:00
|
|
|
// make sure we take into account any children outside our bounds
|
|
|
|
CalculateChildTotalSize(mScrollAreaFrame, scrollAreaDesiredSize);
|
1999-08-27 10:06:39 +04:00
|
|
|
|
|
|
|
|
|
|
|
// its possible that we will have to do this twice. Its a special case
|
|
|
|
// when a the scrollarea is exactly the same height as its content but
|
|
|
|
// the contents width is greater. We will need a horizontal scrollbar
|
|
|
|
// but the size of the scrollbar will cause the scrollarea to be shorter
|
|
|
|
// than the content. So we will need a vertical scrollbar. But that could
|
|
|
|
// require us to squeeze the content. So we would have to reflow. Basically
|
|
|
|
// we have to start over. Thats why this loop is here.
|
|
|
|
for (int i=0; i < 1; i++) {
|
|
|
|
|
|
|
|
// if we are shrink wrapping the height.
|
|
|
|
if (NS_INTRINSICSIZE == scrollAreaSize.height) {
|
|
|
|
// the view port become the size that child requested.
|
|
|
|
scrollAreaSize.height = scrollAreaDesiredSize.height;
|
|
|
|
|
|
|
|
// if we were auto and have a vertical scrollbar remove it because we
|
|
|
|
// can have whatever size we wanted.
|
2000-01-27 00:56:03 +03:00
|
|
|
if (aReflowState.mStyleDisplay->mOverflow != NS_STYLE_OVERFLOW_SCROLL
|
|
|
|
&& aReflowState.mStyleDisplay->mOverflow != NS_STYLE_OVERFLOW_SCROLLBARS_VERTICAL) {
|
1999-08-20 02:16:23 +04:00
|
|
|
RemoveVerticalScrollbar(sbSize, scrollAreaSize);
|
|
|
|
}
|
1999-08-27 10:06:39 +04:00
|
|
|
} else {
|
|
|
|
// if we are not shrink wrapping
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
PRBool mustReflow = PR_FALSE;
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1999-08-27 10:06:39 +04:00
|
|
|
// if we have 'auto' scrollbars
|
2000-01-27 00:56:03 +03:00
|
|
|
if (aReflowState.mStyleDisplay->mOverflow != NS_STYLE_OVERFLOW_SCROLL
|
|
|
|
&& aReflowState.mStyleDisplay->mOverflow != NS_STYLE_OVERFLOW_SCROLLBARS_VERTICAL) {
|
1999-08-27 10:06:39 +04:00
|
|
|
// get the ara frame is the scrollarea
|
|
|
|
nsSize size;
|
2000-01-22 04:16:50 +03:00
|
|
|
GetScrolledContentSize(aPresContext, size);
|
1999-08-27 10:06:39 +04:00
|
|
|
|
|
|
|
// There are two cases to consider
|
2000-01-27 00:56:03 +03:00
|
|
|
if (size.height <= scrollAreaSize.height
|
|
|
|
|| aReflowState.mStyleDisplay->mOverflow == NS_STYLE_OVERFLOW_SCROLLBARS_HORIZONTAL
|
|
|
|
|| aReflowState.mStyleDisplay->mOverflow == NS_STYLE_OVERFLOW_SCROLLBARS_NONE) {
|
1999-08-27 10:06:39 +04:00
|
|
|
if (mHasVerticalScrollbar) {
|
|
|
|
// We left room for the vertical scrollbar, but it's not needed;
|
|
|
|
// remove it.
|
|
|
|
RemoveVerticalScrollbar(sbSize, scrollAreaSize);
|
|
|
|
mustReflow = PR_TRUE;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (!mHasVerticalScrollbar) {
|
|
|
|
// We didn't leave room for the vertical scrollbar, but it turns
|
|
|
|
// out we needed it
|
|
|
|
AddVerticalScrollbar(sbSize, scrollAreaSize);
|
|
|
|
mustReflow = PR_TRUE;
|
|
|
|
}
|
|
|
|
}
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1999-08-27 10:06:39 +04:00
|
|
|
// Go ahead and reflow the child a second time if we added or removed the scrollbar
|
|
|
|
if (mustReflow) {
|
2000-03-02 06:01:30 +03:00
|
|
|
|
|
|
|
// make sure we mark it as dirty so it will reflow again.
|
|
|
|
nsFrameState childState;
|
|
|
|
mScrollAreaFrame->GetFrameState(&childState);
|
|
|
|
childState |= NS_FRAME_IS_DIRTY;
|
|
|
|
mScrollAreaFrame->SetFrameState(childState);
|
|
|
|
|
1999-10-20 04:46:21 +04:00
|
|
|
scrollAreaReflowSize.SizeTo(scrollAreaSize.width, scrollAreaSize.height);
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1999-10-20 04:46:21 +04:00
|
|
|
resized = PR_FALSE;
|
1999-08-27 10:06:39 +04:00
|
|
|
|
|
|
|
ReflowFrame(aPresContext, scrollAreaDesiredSize, aReflowState, aStatus, mScrollAreaFrame,
|
|
|
|
scrollAreaReflowSize,
|
|
|
|
scrollAreaReflowSize,
|
|
|
|
resized,
|
|
|
|
aIncrementalChild);
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1999-08-27 10:06:39 +04:00
|
|
|
CalculateChildTotalSize(mScrollAreaFrame, scrollAreaDesiredSize);
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1999-08-27 10:06:39 +04:00
|
|
|
}
|
1999-08-20 02:16:23 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-08-27 10:06:39 +04:00
|
|
|
// if we are shrink wrapping the scroll area height becomes whatever the child wanted
|
|
|
|
if (NS_INTRINSICSIZE == scrollAreaSize.width) {
|
|
|
|
scrollAreaSize.width = scrollAreaDesiredSize.width;
|
|
|
|
|
|
|
|
// if we have auto scrollbars the remove the horizontal scrollbar
|
2000-01-27 00:56:03 +03:00
|
|
|
if (aReflowState.mStyleDisplay->mOverflow != NS_STYLE_OVERFLOW_SCROLL
|
|
|
|
&& aReflowState.mStyleDisplay->mOverflow != NS_STYLE_OVERFLOW_SCROLLBARS_HORIZONTAL) {
|
1999-08-27 10:06:39 +04:00
|
|
|
RemoveHorizontalScrollbar(sbSize, scrollAreaSize);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
// if scrollbars are auto
|
2000-01-27 00:56:03 +03:00
|
|
|
if ((NS_STYLE_OVERFLOW_SCROLL != aReflowState.mStyleDisplay->mOverflow)
|
|
|
|
&& (NS_STYLE_OVERFLOW_SCROLLBARS_HORIZONTAL != aReflowState.mStyleDisplay->mOverflow))
|
1999-08-27 10:06:39 +04:00
|
|
|
{
|
|
|
|
// get the ara frame is the scrollarea
|
|
|
|
nsSize size;
|
2000-01-22 04:16:50 +03:00
|
|
|
GetScrolledContentSize(aPresContext, size);
|
1999-08-27 10:06:39 +04:00
|
|
|
|
|
|
|
// if the child is wider that the scroll area
|
|
|
|
// and we don't have a scrollbar add one.
|
2000-01-27 00:56:03 +03:00
|
|
|
if (size.width > scrollAreaSize.width
|
|
|
|
&& aReflowState.mStyleDisplay->mOverflow != NS_STYLE_OVERFLOW_SCROLLBARS_VERTICAL
|
|
|
|
&& aReflowState.mStyleDisplay->mOverflow != NS_STYLE_OVERFLOW_SCROLLBARS_NONE) {
|
1999-08-27 10:06:39 +04:00
|
|
|
|
|
|
|
if (!mHasHorizontalScrollbar) {
|
|
|
|
AddHorizontalScrollbar(sbSize, scrollAreaSize);
|
|
|
|
|
|
|
|
// if we added a horizonal scrollbar and we did not have a vertical
|
|
|
|
// there is a chance that by adding the horizonal scrollbar we will
|
|
|
|
// suddenly need a vertical scrollbar. Is a special case but its
|
|
|
|
// important.
|
|
|
|
if (!mHasVerticalScrollbar && size.height > scrollAreaSize.height - sbSize.height)
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
// if the area is smaller or equal to and we have a scrollbar then
|
|
|
|
// remove it.
|
|
|
|
RemoveHorizontalScrollbar(sbSize, scrollAreaSize);
|
|
|
|
}
|
|
|
|
}
|
1999-08-20 02:16:23 +04:00
|
|
|
}
|
|
|
|
|
1999-08-27 10:06:39 +04:00
|
|
|
// always break out of the loop. Only continue if another scrollbar was added.
|
|
|
|
break;
|
1999-08-20 02:16:23 +04:00
|
|
|
}
|
|
|
|
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
/*
|
|
|
|
// the old scroll area includes our margin. If our margin changed it will cause the
|
|
|
|
// scrollbars to be recalculated as well.
|
|
|
|
nsSize marginedScrollAreaSize = scrollAreaSize;
|
|
|
|
marginedScrollAreaSize.width += aReflowState.mComputedPadding.left + aReflowState.mComputedPadding.right;
|
|
|
|
marginedScrollAreaSize.height += aReflowState.mComputedPadding.top + aReflowState.mComputedPadding.bottom;
|
|
|
|
*/
|
1999-08-20 02:16:23 +04:00
|
|
|
|
|
|
|
nsSize size;
|
2000-01-22 04:16:50 +03:00
|
|
|
GetScrolledContentSize(aPresContext, size);
|
1999-08-20 02:16:23 +04:00
|
|
|
|
|
|
|
float p2t;
|
1999-11-24 09:03:41 +03:00
|
|
|
aPresContext->GetScaledPixelsToTwips(&p2t);
|
1999-08-20 02:16:23 +04:00
|
|
|
mOnePixel = NSIntPixelsToTwips(1, p2t);
|
|
|
|
const nsStyleFont* font;
|
1999-10-12 04:16:06 +04:00
|
|
|
mOuter->GetStyleData(eStyleStruct_Font, (const nsStyleStruct*&) font);
|
1999-08-20 02:16:23 +04:00
|
|
|
const nsFont& f = font->mFont;
|
|
|
|
nsCOMPtr<nsIFontMetrics> fm;
|
1999-11-24 09:03:41 +03:00
|
|
|
aPresContext->GetMetricsFor(f, getter_AddRefs(fm));
|
1999-08-20 02:16:23 +04:00
|
|
|
nscoord fontHeight = 1;
|
|
|
|
fm->GetHeight(fontHeight);
|
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
nscoord maxX = size.width - scrollAreaSize.width;
|
|
|
|
nscoord maxY = size.height - scrollAreaSize.height;
|
|
|
|
|
1999-11-24 09:03:41 +03:00
|
|
|
nsIScrollableView* scrollable = GetScrollableView(aPresContext);
|
1999-10-12 04:16:06 +04:00
|
|
|
scrollable->SetLineHeight(fontHeight);
|
|
|
|
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
// set the scrollbars properties. Mark the scrollbars for reflow if there values change.
|
|
|
|
if (mHasVerticalScrollbar) {
|
|
|
|
SetAttribute(mVScrollbarFrame, nsXULAtoms::maxpos, maxY);
|
|
|
|
SetAttribute(mVScrollbarFrame, nsXULAtoms::pageincrement, nscoord(scrollAreaSize.height - fontHeight));
|
|
|
|
SetAttribute(mVScrollbarFrame, nsXULAtoms::increment, fontHeight, PR_FALSE);
|
|
|
|
}
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
if (mHasHorizontalScrollbar) {
|
2000-03-09 04:37:23 +03:00
|
|
|
SetAttribute(mHScrollbarFrame, nsXULAtoms::maxpos, maxX);
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
SetAttribute(mHScrollbarFrame, nsXULAtoms::pageincrement, nscoord(float(scrollAreaSize.width)*0.8));
|
|
|
|
SetAttribute(mHScrollbarFrame, nsXULAtoms::increment, 10*mOnePixel, PR_FALSE);
|
|
|
|
}
|
1999-08-20 02:16:23 +04:00
|
|
|
// size the scroll area
|
|
|
|
// 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
|
|
|
|
|
1999-11-24 09:03:41 +03:00
|
|
|
SetFrameSize(aPresContext, mScrollAreaFrame, scrollAreaSize);
|
1999-08-20 02:16:23 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Places the scrollbars and scrollarea and returns the overall size
|
|
|
|
*/
|
|
|
|
void
|
1999-11-24 09:03:41 +03:00
|
|
|
nsGfxScrollFrameInner::LayoutChildren(nsIPresContext* aPresContext,
|
1999-08-20 02:16:23 +04:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState)
|
|
|
|
{
|
|
|
|
nsSize scrollAreaSize;
|
|
|
|
GetFrameSize(mScrollAreaFrame, scrollAreaSize);
|
|
|
|
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
// add the padding to it.
|
|
|
|
scrollAreaSize.width += aReflowState.mComputedPadding.left + aReflowState.mComputedPadding.right;
|
|
|
|
scrollAreaSize.height += aReflowState.mComputedPadding.top + aReflowState.mComputedPadding.bottom;
|
|
|
|
|
1999-08-20 02:16:23 +04:00
|
|
|
nsSize sbSize;
|
|
|
|
GetScrollbarDimensions(aPresContext, sbSize);
|
|
|
|
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
const nsMargin& borderPadding = aReflowState.mComputedBorderPadding;
|
|
|
|
nsMargin border = borderPadding - aReflowState.mComputedPadding;
|
1999-08-20 02:16:23 +04:00
|
|
|
|
|
|
|
// Place scroll area
|
1999-11-19 18:33:29 +03:00
|
|
|
nsIView* view;
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
mScrollAreaFrame->MoveTo(aPresContext, borderPadding.left, borderPadding.top);
|
1999-11-24 09:03:41 +03:00
|
|
|
mScrollAreaFrame->GetView(aPresContext, &view);
|
1999-11-19 18:33:29 +03:00
|
|
|
if (view) {
|
1999-11-24 09:03:41 +03:00
|
|
|
nsContainerFrame::SyncFrameViewAfterReflow(aPresContext, mScrollAreaFrame,
|
1999-11-19 18:33:29 +03:00
|
|
|
view, nsnull);
|
|
|
|
}
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
// place vertical scrollbar move by the border because the scrollbars are outside our padding
|
1999-11-24 09:03:41 +03:00
|
|
|
mVScrollbarFrame->MoveTo(aPresContext, border.left + scrollAreaSize.width, border.top);
|
|
|
|
mVScrollbarFrame->GetView(aPresContext, &view);
|
1999-11-19 18:33:29 +03:00
|
|
|
if (view) {
|
1999-11-24 09:03:41 +03:00
|
|
|
nsContainerFrame::SyncFrameViewAfterReflow(aPresContext, mVScrollbarFrame,
|
1999-11-19 18:33:29 +03:00
|
|
|
view, nsnull);
|
|
|
|
}
|
1999-08-20 02:16:23 +04:00
|
|
|
|
|
|
|
// place horizontal scrollbar
|
1999-11-24 09:03:41 +03:00
|
|
|
mHScrollbarFrame->MoveTo(aPresContext, border.left, border.top + scrollAreaSize.height);
|
|
|
|
mHScrollbarFrame->GetView(aPresContext, &view);
|
1999-11-19 18:33:29 +03:00
|
|
|
if (view) {
|
1999-11-24 09:03:41 +03:00
|
|
|
nsContainerFrame::SyncFrameViewAfterReflow(aPresContext, mHScrollbarFrame,
|
1999-11-19 18:33:29 +03:00
|
|
|
view, nsnull);
|
|
|
|
}
|
1999-08-20 02:16:23 +04:00
|
|
|
|
|
|
|
// Compute our desired size
|
|
|
|
// ---------- compute width -----------
|
|
|
|
aDesiredSize.width = scrollAreaSize.width;
|
|
|
|
|
|
|
|
// add border
|
1999-10-12 04:16:06 +04:00
|
|
|
aDesiredSize.width += border.left + border.right;
|
1999-08-20 02:16:23 +04:00
|
|
|
|
|
|
|
// add scrollbar
|
|
|
|
if (mHasVerticalScrollbar)
|
|
|
|
aDesiredSize.width += sbSize.width;
|
|
|
|
|
|
|
|
// ---------- compute height -----------
|
|
|
|
|
|
|
|
/*
|
|
|
|
// For the height if we're shrink wrapping then use whatever is smaller between
|
|
|
|
// the available height and the child's desired size; otherwise, use the scroll
|
|
|
|
// area size
|
|
|
|
if (NS_AUTOHEIGHT == aReflowState.mComputedHeight) {
|
|
|
|
aDesiredSize.height = PR_MIN(aReflowState.availableHeight, scrollAreaSize.height);
|
|
|
|
} else {
|
|
|
|
*/
|
|
|
|
|
|
|
|
aDesiredSize.height = scrollAreaSize.height;
|
|
|
|
//}
|
|
|
|
|
|
|
|
// add the scrollbar in
|
|
|
|
if (mHasHorizontalScrollbar)
|
|
|
|
aDesiredSize.height += sbSize.height;
|
|
|
|
|
|
|
|
// add in our border
|
1999-10-12 04:16:06 +04:00
|
|
|
aDesiredSize.height += border.top + border.bottom;
|
1999-08-20 02:16:23 +04:00
|
|
|
|
|
|
|
|
|
|
|
aDesiredSize.ascent = aDesiredSize.height;
|
|
|
|
aDesiredSize.descent = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-10-26 08:44:41 +04:00
|
|
|
nsGfxScrollFrameInner::ScrollbarChanged(nsIPresContext* aPresContext, nscoord aX, nscoord aY)
|
1999-08-20 02:16:23 +04:00
|
|
|
{
|
1999-10-26 08:44:41 +04:00
|
|
|
nsIScrollableView* scrollable = GetScrollableView(aPresContext);
|
1999-08-27 10:06:39 +04:00
|
|
|
scrollable->ScrollTo(aX,aY, NS_SCROLL_PROPERTY_ALWAYS_BLIT);
|
|
|
|
// printf("scrolling to: %d, %d\n", aX, aY);
|
1999-08-20 02:16:23 +04:00
|
|
|
}
|
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
nsGfxScrollFrameInner::~nsGfxScrollFrameInner()
|
|
|
|
{
|
|
|
|
if (mDocument) {
|
|
|
|
mDocument->RemoveObserver(this);
|
|
|
|
mDocument = nsnull;
|
|
|
|
}
|
1999-08-20 02:16:23 +04:00
|
|
|
}
|
|
|
|
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
/**
|
|
|
|
* Returns whether it actually needed to change the attribute
|
|
|
|
*/
|
|
|
|
PRBool
|
|
|
|
nsGfxScrollFrameInner::SetAttribute(nsIFrame* aFrame, nsIAtom* aAtom, nscoord aSize, PRBool aReflow)
|
1999-08-20 02:16:23 +04:00
|
|
|
{
|
|
|
|
// convert to pixels
|
|
|
|
aSize /= mOnePixel;
|
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
// only set the attribute if it changed.
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
PRInt32 current = GetIntegerAttribute(aFrame, aAtom, -1);
|
|
|
|
if (current != aSize)
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIContent> content;
|
|
|
|
aFrame->GetContent(getter_AddRefs(content));
|
|
|
|
char ch[100];
|
|
|
|
sprintf(ch,"%d", aSize);
|
Landing changes Vidur made while the tree was closed for beta1 work, here's a list of the changes. r=me
[1] Cutting down the size of content. Made nsIJSScriptObject inherit from nsIScriptObjectOwner
[2] Cutting down the size of content. Made nsITextContent inherit from nsIContent.
[3] Cutting down the size of content. Moved implementation of nsIDOMReceiver to nsListenerManager. This is not true aggregation since it isn't transitive, but it's OK for now. It will be necessary for nsListenerManager to have a reference to its content in the future anyway, so the transitivity could be done.
dom/public/nsDOMPropEnums.h,v - bug 12559
dom/public/nsIJSScriptObject.h,v - [1]
dom/public/html/MANIFEST,v - bug 12559
dom/public/html/Makefile.in,v - bug 12559
dom/public/html/makefile.win,v - bug 12559
dom/public/html/nsIDOMHTMLInputElement.h,v - bug 17544
dom/public/idl/html/HTMLAnchorElement.idl,v - bug 12559
dom/public/idl/html/HTMLAreaElement.idl,v - bug 12559
dom/public/idl/html/HTMLInputElement.idl,v - bug 17544
dom/src/base/nsGlobalWindow.cpp,v - bug 30700
dom/src/base/nsGlobalWindow.h,v - [1]
dom/src/base/nsLocation.cpp,v - [1]
dom/src/html/nsJSHTMLAnchorElement.cpp,v - bug 12559
dom/src/html/nsJSHTMLAreaElement.cpp,v - bug 12559
dom/src/html/nsJSHTMLInputElement.cpp,v - bug 17544
layout/base/public/nsIDocument.h,v - bug 27953
layout/base/public/nsITextContent.h,v - [2]
layout/base/src/nsCommentNode.cpp,v - [2]
layout/base/src/nsDocument.cpp,v - bug 27953
layout/base/src/nsDocument.h,v - bug 27953
layout/base/src/nsDocumentViewer.cpp,v - bug 27953
layout/base/src/nsGenericDOMDataNode.cpp,v - [3]
layout/base/src/nsGenericDOMDataNode.h,v - [3]
layout/base/src/nsGenericElement.cpp,v - [3]
layout/base/src/nsGenericElement.h,v - [3]
layout/base/src/nsNameSpaceManager.cpp,v - bug 7834
layout/base/src/nsStyleContext.cpp,v - outline property shouldn't reflow
layout/base/src/nsTextNode.cpp,v - [2]
layout/events/src/nsEventListenerManager.cpp,v - [3]
layout/events/src/nsEventListenerManager.h,v - [3]
layout/html/base/src/nsGfxScrollFrame.cpp,v - nsString->nsAutoString
layout/html/content/src/nsAttributeContent.cpp,v - [2]
layout/html/content/src/nsHTMLAnchorElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLAppletElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLAreaElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBRElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBaseElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBaseFontElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBodyElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLButtonElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDListElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDelElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDirectoryElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDivElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLEmbedElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFieldSetElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFontElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFormElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFrameElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFrameSetElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHRElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHeadElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHeadingElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHtmlElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLIFrameElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLImageElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLInputElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLInsElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLIsIndexElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLIElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLabelElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLayerElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLegendElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLinkElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLMapElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLMenuElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLMetaElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLModElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLOListElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLObjectElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLOptGroupElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLOptionElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLParagraphElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLParamElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLPreElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLQuoteElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLScriptElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLSelectElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLSpacerElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLSpanElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLStyleElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableCaptionElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableCellElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableColElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableColGroupElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableRowElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableSectionElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTextAreaElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTitleElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLUListElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLWBRElement.cpp,v - [1][3]
layout/html/document/src/nsHTMLDocument.cpp,v - bug 27953
layout/html/document/src/nsHTMLDocument.h,v - bug 27953
layout/xml/content/src/nsXMLCDATASection.cpp,v - [1][2]
layout/xml/content/src/nsXMLDocumentType.cpp,v - [1][2]
layout/xml/content/src/nsXMLElement.h,v - [1][2]
layout/xml/content/src/nsXMLEntity.cpp,v - [1][2]
layout/xml/content/src/nsXMLNotation.cpp,v - [1][2]
layout/xml/content/src/nsXMLProcessingInstruction.cpp,v - [1][2]
layout/xul/base/src/nsBoxFrame.cpp,v - nsString->nsAutoString
layout/xul/base/src/nsSliderFrame.cpp,v - nsString->nsAutoString
netwerk/protocol/http/src/nsHTTPRequest.cpp,v - nsString->nsAutoString
rdf/content/src/nsXULDocument.cpp,v - bug 27953
rdf/content/src/nsXULDocument.h,v - bug 27953
rdf/content/src/nsXULElement.h,v - [1]
xpcom/base/IIDS.h,v - bug 12559
2000-03-17 16:27:00 +03:00
|
|
|
nsAutoString newValue(ch);
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
content->SetAttribute(kNameSpaceID_None, aAtom, newValue, aReflow);
|
|
|
|
return PR_TRUE;
|
1999-10-12 04:16:06 +04:00
|
|
|
}
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
|
|
|
|
return PR_FALSE;
|
1999-08-20 02:16:23 +04:00
|
|
|
}
|
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
PRInt32
|
|
|
|
nsGfxScrollFrameInner::GetIntegerAttribute(nsIFrame* aFrame, nsIAtom* atom, PRInt32 defaultValue)
|
1999-08-20 02:16:23 +04:00
|
|
|
{
|
1999-10-12 04:16:06 +04:00
|
|
|
nsCOMPtr<nsIContent> content;
|
|
|
|
aFrame->GetContent(getter_AddRefs(content));
|
1999-08-20 02:16:23 +04:00
|
|
|
|
Landing changes Vidur made while the tree was closed for beta1 work, here's a list of the changes. r=me
[1] Cutting down the size of content. Made nsIJSScriptObject inherit from nsIScriptObjectOwner
[2] Cutting down the size of content. Made nsITextContent inherit from nsIContent.
[3] Cutting down the size of content. Moved implementation of nsIDOMReceiver to nsListenerManager. This is not true aggregation since it isn't transitive, but it's OK for now. It will be necessary for nsListenerManager to have a reference to its content in the future anyway, so the transitivity could be done.
dom/public/nsDOMPropEnums.h,v - bug 12559
dom/public/nsIJSScriptObject.h,v - [1]
dom/public/html/MANIFEST,v - bug 12559
dom/public/html/Makefile.in,v - bug 12559
dom/public/html/makefile.win,v - bug 12559
dom/public/html/nsIDOMHTMLInputElement.h,v - bug 17544
dom/public/idl/html/HTMLAnchorElement.idl,v - bug 12559
dom/public/idl/html/HTMLAreaElement.idl,v - bug 12559
dom/public/idl/html/HTMLInputElement.idl,v - bug 17544
dom/src/base/nsGlobalWindow.cpp,v - bug 30700
dom/src/base/nsGlobalWindow.h,v - [1]
dom/src/base/nsLocation.cpp,v - [1]
dom/src/html/nsJSHTMLAnchorElement.cpp,v - bug 12559
dom/src/html/nsJSHTMLAreaElement.cpp,v - bug 12559
dom/src/html/nsJSHTMLInputElement.cpp,v - bug 17544
layout/base/public/nsIDocument.h,v - bug 27953
layout/base/public/nsITextContent.h,v - [2]
layout/base/src/nsCommentNode.cpp,v - [2]
layout/base/src/nsDocument.cpp,v - bug 27953
layout/base/src/nsDocument.h,v - bug 27953
layout/base/src/nsDocumentViewer.cpp,v - bug 27953
layout/base/src/nsGenericDOMDataNode.cpp,v - [3]
layout/base/src/nsGenericDOMDataNode.h,v - [3]
layout/base/src/nsGenericElement.cpp,v - [3]
layout/base/src/nsGenericElement.h,v - [3]
layout/base/src/nsNameSpaceManager.cpp,v - bug 7834
layout/base/src/nsStyleContext.cpp,v - outline property shouldn't reflow
layout/base/src/nsTextNode.cpp,v - [2]
layout/events/src/nsEventListenerManager.cpp,v - [3]
layout/events/src/nsEventListenerManager.h,v - [3]
layout/html/base/src/nsGfxScrollFrame.cpp,v - nsString->nsAutoString
layout/html/content/src/nsAttributeContent.cpp,v - [2]
layout/html/content/src/nsHTMLAnchorElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLAppletElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLAreaElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBRElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBaseElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBaseFontElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBodyElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLButtonElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDListElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDelElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDirectoryElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDivElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLEmbedElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFieldSetElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFontElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFormElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFrameElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFrameSetElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHRElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHeadElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHeadingElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHtmlElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLIFrameElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLImageElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLInputElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLInsElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLIsIndexElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLIElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLabelElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLayerElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLegendElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLinkElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLMapElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLMenuElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLMetaElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLModElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLOListElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLObjectElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLOptGroupElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLOptionElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLParagraphElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLParamElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLPreElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLQuoteElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLScriptElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLSelectElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLSpacerElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLSpanElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLStyleElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableCaptionElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableCellElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableColElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableColGroupElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableRowElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableSectionElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTextAreaElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTitleElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLUListElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLWBRElement.cpp,v - [1][3]
layout/html/document/src/nsHTMLDocument.cpp,v - bug 27953
layout/html/document/src/nsHTMLDocument.h,v - bug 27953
layout/xml/content/src/nsXMLCDATASection.cpp,v - [1][2]
layout/xml/content/src/nsXMLDocumentType.cpp,v - [1][2]
layout/xml/content/src/nsXMLElement.h,v - [1][2]
layout/xml/content/src/nsXMLEntity.cpp,v - [1][2]
layout/xml/content/src/nsXMLNotation.cpp,v - [1][2]
layout/xml/content/src/nsXMLProcessingInstruction.cpp,v - [1][2]
layout/xul/base/src/nsBoxFrame.cpp,v - nsString->nsAutoString
layout/xul/base/src/nsSliderFrame.cpp,v - nsString->nsAutoString
netwerk/protocol/http/src/nsHTTPRequest.cpp,v - nsString->nsAutoString
rdf/content/src/nsXULDocument.cpp,v - bug 27953
rdf/content/src/nsXULDocument.h,v - bug 27953
rdf/content/src/nsXULElement.h,v - [1]
xpcom/base/IIDS.h,v - bug 12559
2000-03-17 16:27:00 +03:00
|
|
|
nsAutoString value;
|
1999-10-12 04:16:06 +04:00
|
|
|
if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, atom, value))
|
|
|
|
{
|
|
|
|
PRInt32 error;
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
// convert it to an integer
|
|
|
|
defaultValue = value.ToInteger(&error);
|
|
|
|
}
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
return defaultValue;
|
1999-08-20 02:16:23 +04:00
|
|
|
}
|
|
|
|
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsGfxScrollFrame::InvalidateCache(nsIFrame* aChild)
|
|
|
|
{
|
|
|
|
// we don't cache any layout information. So do nothing.
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2000-03-02 06:01:30 +03:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsGfxScrollFrame::SetDebug(nsIPresContext* aPresContext, PRBool aDebug)
|
|
|
|
{
|
|
|
|
nsIFrame* kid = mFrames.FirstChild();
|
|
|
|
while (nsnull != kid) {
|
|
|
|
nsIBox* ibox = nsnull;
|
|
|
|
if (NS_SUCCEEDED(kid->QueryInterface(NS_GET_IID(nsIBox), (void**)&ibox)) && ibox) {
|
|
|
|
ibox->SetDebug(aPresContext, aDebug);
|
|
|
|
}
|
|
|
|
|
|
|
|
kid->GetNextSibling(&kid);
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
1999-08-20 02:16:23 +04:00
|
|
|
|
|
|
|
NS_IMETHODIMP
|
1999-11-24 09:03:41 +03:00
|
|
|
nsGfxScrollFrame::GetBoxInfo(nsIPresContext* aPresContext, const nsHTMLReflowState& aReflowState, nsBoxInfo& aSize)
|
1999-08-20 02:16:23 +04:00
|
|
|
{
|
2000-02-25 07:18:34 +03:00
|
|
|
|
|
|
|
nsIFrame* incrementalChild = nsnull;
|
|
|
|
|
|
|
|
// if incremental pop off the child if it is ours and mark it dirty.
|
|
|
|
if (aReflowState.reason == eReflowReason_Incremental) {
|
|
|
|
aReflowState.reflowCommand->GetNext(incrementalChild, PR_FALSE);
|
|
|
|
if (incrementalChild == mInner->mScrollAreaFrame ||
|
|
|
|
incrementalChild == mInner->mVScrollbarFrame ||
|
|
|
|
incrementalChild == mInner->mHScrollbarFrame) {
|
|
|
|
aReflowState.reflowCommand->GetNext(incrementalChild);
|
|
|
|
// mark it dirty
|
|
|
|
nsFrameState childState;
|
|
|
|
incrementalChild->GetFrameState(&childState);
|
|
|
|
childState |= NS_FRAME_IS_DIRTY;
|
|
|
|
incrementalChild->SetFrameState(childState);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-12-02 04:07:27 +03:00
|
|
|
aSize.Clear();
|
1999-10-12 04:16:06 +04:00
|
|
|
|
|
|
|
nsBoxInfo scrollAreaInfo, vboxInfo, hboxInfo;
|
2000-01-06 08:55:46 +03:00
|
|
|
nsCOMPtr<nsIBox> ibox ( do_QueryInterface(mInner->mScrollAreaFrame) );
|
1999-12-24 02:44:56 +03:00
|
|
|
if (ibox) ibox->GetBoxInfo(aPresContext, aReflowState, scrollAreaInfo);
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
if (mInner->mHasVerticalScrollbar) {
|
2000-01-06 08:55:46 +03:00
|
|
|
nsCOMPtr<nsIBox> vScrollbarBox ( do_QueryInterface(mInner->mVScrollbarFrame) );
|
|
|
|
if (vScrollbarBox) vScrollbarBox->GetBoxInfo(aPresContext, aReflowState, vboxInfo);
|
1999-08-20 02:16:23 +04:00
|
|
|
}
|
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
if (mInner->mHasHorizontalScrollbar) {
|
2000-01-06 08:55:46 +03:00
|
|
|
nsCOMPtr<nsIBox> hScrollbarBox ( do_QueryInterface(mInner->mHScrollbarFrame) );
|
|
|
|
if (hScrollbarBox) hScrollbarBox->GetBoxInfo(aPresContext, aReflowState, hboxInfo);
|
1999-08-20 02:16:23 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
aSize.prefSize.width += scrollAreaInfo.prefSize.width + vboxInfo.prefSize.width;
|
|
|
|
aSize.prefSize.height += scrollAreaInfo.prefSize.height + hboxInfo.prefSize.height;
|
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
aSize.minSize.width += vboxInfo.minSize.width;
|
|
|
|
aSize.minSize.height += hboxInfo.minSize.height;
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
if (scrollAreaInfo.maxSize.width != NS_INTRINSICSIZE &&
|
|
|
|
vboxInfo.maxSize.width != NS_INTRINSICSIZE &&
|
|
|
|
hboxInfo.maxSize.width != NS_INTRINSICSIZE)
|
1999-08-20 02:16:23 +04:00
|
|
|
{
|
1999-10-12 04:16:06 +04:00
|
|
|
aSize.maxSize.width += scrollAreaInfo.maxSize.width + vboxInfo.maxSize.width + hboxInfo.maxSize.width;
|
|
|
|
}
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
if (scrollAreaInfo.maxSize.height != NS_INTRINSICSIZE &&
|
|
|
|
vboxInfo.maxSize.height != NS_INTRINSICSIZE &&
|
|
|
|
hboxInfo.maxSize.height != NS_INTRINSICSIZE)
|
|
|
|
{
|
|
|
|
aSize.maxSize.height += scrollAreaInfo.maxSize.height + vboxInfo.maxSize.height + hboxInfo.maxSize.height;
|
|
|
|
}
|
1999-08-20 02:16:23 +04:00
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
/*
|
1999-08-20 02:16:23 +04:00
|
|
|
void
|
|
|
|
nsBoxFrame::GetRedefinedMinPrefMax(nsIFrame* aFrame, nsBoxInfo& aSize)
|
|
|
|
{
|
|
|
|
// add in the css min, max, pref
|
|
|
|
const nsStylePosition* position;
|
|
|
|
nsresult rv = aFrame->GetStyleData(eStyleStruct_Position,
|
|
|
|
(const nsStyleStruct*&) position);
|
|
|
|
|
|
|
|
// see if the width or height was specifically set
|
|
|
|
if (position->mWidth.GetUnit() == eStyleUnit_Coord) {
|
|
|
|
aSize.prefSize.width = position->mWidth.GetCoordValue();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (position->mHeight.GetUnit() == eStyleUnit_Coord) {
|
|
|
|
aSize.prefSize.height = position->mHeight.GetCoordValue();
|
|
|
|
}
|
|
|
|
|
|
|
|
// same for min size. Unfortunately min size is always set to 0. So for now
|
|
|
|
// we will assume 0 means not set.
|
|
|
|
if (position->mMinWidth.GetUnit() == eStyleUnit_Coord) {
|
|
|
|
nscoord min = position->mMinWidth.GetCoordValue();
|
|
|
|
if (min != 0)
|
|
|
|
aSize.minSize.width = min;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (position->mMinHeight.GetUnit() == eStyleUnit_Coord) {
|
|
|
|
nscoord min = position->mMinHeight.GetCoordValue();
|
|
|
|
if (min != 0)
|
|
|
|
aSize.minSize.height = min;
|
|
|
|
}
|
|
|
|
|
|
|
|
// and max
|
|
|
|
if (position->mMaxWidth.GetUnit() == eStyleUnit_Coord) {
|
|
|
|
nscoord max = position->mMaxWidth.GetCoordValue();
|
|
|
|
aSize.maxSize.width = max;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (position->mMaxHeight.GetUnit() == eStyleUnit_Coord) {
|
|
|
|
nscoord max = position->mMaxHeight.GetCoordValue();
|
|
|
|
aSize.maxSize.height = max;
|
|
|
|
}
|
|
|
|
|
|
|
|
// get the flexibility
|
|
|
|
nsCOMPtr<nsIContent> content;
|
|
|
|
aFrame->GetContent(getter_AddRefs(content));
|
|
|
|
|
|
|
|
PRInt32 error;
|
Landing changes Vidur made while the tree was closed for beta1 work, here's a list of the changes. r=me
[1] Cutting down the size of content. Made nsIJSScriptObject inherit from nsIScriptObjectOwner
[2] Cutting down the size of content. Made nsITextContent inherit from nsIContent.
[3] Cutting down the size of content. Moved implementation of nsIDOMReceiver to nsListenerManager. This is not true aggregation since it isn't transitive, but it's OK for now. It will be necessary for nsListenerManager to have a reference to its content in the future anyway, so the transitivity could be done.
dom/public/nsDOMPropEnums.h,v - bug 12559
dom/public/nsIJSScriptObject.h,v - [1]
dom/public/html/MANIFEST,v - bug 12559
dom/public/html/Makefile.in,v - bug 12559
dom/public/html/makefile.win,v - bug 12559
dom/public/html/nsIDOMHTMLInputElement.h,v - bug 17544
dom/public/idl/html/HTMLAnchorElement.idl,v - bug 12559
dom/public/idl/html/HTMLAreaElement.idl,v - bug 12559
dom/public/idl/html/HTMLInputElement.idl,v - bug 17544
dom/src/base/nsGlobalWindow.cpp,v - bug 30700
dom/src/base/nsGlobalWindow.h,v - [1]
dom/src/base/nsLocation.cpp,v - [1]
dom/src/html/nsJSHTMLAnchorElement.cpp,v - bug 12559
dom/src/html/nsJSHTMLAreaElement.cpp,v - bug 12559
dom/src/html/nsJSHTMLInputElement.cpp,v - bug 17544
layout/base/public/nsIDocument.h,v - bug 27953
layout/base/public/nsITextContent.h,v - [2]
layout/base/src/nsCommentNode.cpp,v - [2]
layout/base/src/nsDocument.cpp,v - bug 27953
layout/base/src/nsDocument.h,v - bug 27953
layout/base/src/nsDocumentViewer.cpp,v - bug 27953
layout/base/src/nsGenericDOMDataNode.cpp,v - [3]
layout/base/src/nsGenericDOMDataNode.h,v - [3]
layout/base/src/nsGenericElement.cpp,v - [3]
layout/base/src/nsGenericElement.h,v - [3]
layout/base/src/nsNameSpaceManager.cpp,v - bug 7834
layout/base/src/nsStyleContext.cpp,v - outline property shouldn't reflow
layout/base/src/nsTextNode.cpp,v - [2]
layout/events/src/nsEventListenerManager.cpp,v - [3]
layout/events/src/nsEventListenerManager.h,v - [3]
layout/html/base/src/nsGfxScrollFrame.cpp,v - nsString->nsAutoString
layout/html/content/src/nsAttributeContent.cpp,v - [2]
layout/html/content/src/nsHTMLAnchorElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLAppletElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLAreaElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBRElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBaseElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBaseFontElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBodyElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLButtonElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDListElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDelElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDirectoryElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDivElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLEmbedElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFieldSetElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFontElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFormElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFrameElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFrameSetElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHRElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHeadElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHeadingElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHtmlElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLIFrameElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLImageElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLInputElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLInsElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLIsIndexElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLIElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLabelElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLayerElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLegendElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLinkElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLMapElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLMenuElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLMetaElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLModElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLOListElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLObjectElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLOptGroupElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLOptionElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLParagraphElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLParamElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLPreElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLQuoteElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLScriptElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLSelectElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLSpacerElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLSpanElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLStyleElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableCaptionElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableCellElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableColElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableColGroupElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableRowElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableSectionElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTextAreaElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTitleElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLUListElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLWBRElement.cpp,v - [1][3]
layout/html/document/src/nsHTMLDocument.cpp,v - bug 27953
layout/html/document/src/nsHTMLDocument.h,v - bug 27953
layout/xml/content/src/nsXMLCDATASection.cpp,v - [1][2]
layout/xml/content/src/nsXMLDocumentType.cpp,v - [1][2]
layout/xml/content/src/nsXMLElement.h,v - [1][2]
layout/xml/content/src/nsXMLEntity.cpp,v - [1][2]
layout/xml/content/src/nsXMLNotation.cpp,v - [1][2]
layout/xml/content/src/nsXMLProcessingInstruction.cpp,v - [1][2]
layout/xul/base/src/nsBoxFrame.cpp,v - nsString->nsAutoString
layout/xul/base/src/nsSliderFrame.cpp,v - nsString->nsAutoString
netwerk/protocol/http/src/nsHTTPRequest.cpp,v - nsString->nsAutoString
rdf/content/src/nsXULDocument.cpp,v - bug 27953
rdf/content/src/nsXULDocument.h,v - bug 27953
rdf/content/src/nsXULElement.h,v - [1]
xpcom/base/IIDS.h,v - bug 12559
2000-03-17 16:27:00 +03:00
|
|
|
nsAutoString value;
|
1999-08-20 02:16:23 +04:00
|
|
|
|
|
|
|
if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, nsXULAtoms::flex, value))
|
|
|
|
{
|
|
|
|
value.Trim("%");
|
|
|
|
// convert to a percent.
|
|
|
|
aSize.flex = value.ToFloat(&error)/float(100.0);
|
|
|
|
}
|
|
|
|
}
|
1999-10-12 04:16:06 +04:00
|
|
|
*/
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
|
1999-08-20 02:16:23 +04:00
|
|
|
NS_IMETHODIMP
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
nsGfxScrollFrame::ReflowDirtyChild(nsIPresShell* aPresShell, nsIFrame* aChild)
|
1999-08-20 02:16:23 +04:00
|
|
|
{
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
// if the frame is a vertical or horizontal scrollbar and we are about
|
|
|
|
// to reflow the scrollbars then don't propagate up
|
|
|
|
if (aChild == mInner->mHScrollbarFrame || aChild == mInner->mVScrollbarFrame) {
|
|
|
|
|
|
|
|
// First pass means we will be checking to see if children should be reflowed
|
|
|
|
// if (mInner->mFirstPass)
|
|
|
|
// return NS_OK;
|
1999-08-20 02:16:23 +04:00
|
|
|
}
|
|
|
|
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
// if we aren't dirty dirty us
|
|
|
|
if (!(mState & NS_FRAME_IS_DIRTY)) {
|
|
|
|
mState |= NS_FRAME_IS_DIRTY;
|
|
|
|
// if out parent is a box ask it to post a reflow for us and mark us as dirty
|
|
|
|
return mParent->ReflowDirtyChild(aPresShell,this);
|
|
|
|
}
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1) implememted box reflow coelescing.
2) implemented gfx scrollbars for list boxes
3) fixed progess meter to be an animated gif
4) fixed bugs 23521, 24721, 19114, 20546, 24385, 24457, 23156, 20226, 22543
-r hyatt, troy, rod
2000-02-10 01:02:40 +03:00
|
|
|
return NS_OK;
|
1999-08-20 02:16:23 +04:00
|
|
|
}
|
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
nsresult
|
|
|
|
nsGfxScrollFrameInner::GetContentOf(nsIFrame* aFrame, nsIContent** aContent)
|
1999-08-20 02:16:23 +04:00
|
|
|
{
|
1999-10-12 04:16:06 +04:00
|
|
|
// If we don't have a content node find a parent that does.
|
|
|
|
while(aFrame != nsnull) {
|
|
|
|
aFrame->GetContent(aContent);
|
|
|
|
if (*aContent != nsnull)
|
|
|
|
return NS_OK;
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1999-10-12 04:16:06 +04:00
|
|
|
aFrame->GetParent(&aFrame);
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_ERROR("Can't find a parent with a content node");
|
1999-08-20 02:16:23 +04:00
|
|
|
return NS_OK;
|
|
|
|
}
|
1999-10-12 04:16:06 +04:00
|
|
|
|