зеркало из https://github.com/mozilla/pjs.git
Bug 266890. Remove nsScrollPortFrame since it's the only subclass of nsScrollBoxFrame, just merge everything up to nsScrollBoxFrame. r+sr=bryner
This commit is contained in:
Родитель
d7329496e2
Коммит
118cfea877
|
@ -110,9 +110,9 @@
|
|||
#include "nsLayoutErrors.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsScrollPortFrame.h"
|
||||
#include "nsXULAtoms.h"
|
||||
#include "nsBoxFrame.h"
|
||||
#include "nsScrollBoxFrame.h"
|
||||
#include "nsIBoxLayout.h"
|
||||
#ifdef MOZ_ENABLE_CAIRO
|
||||
#include "nsCanvasFrame.h"
|
||||
|
@ -357,9 +357,6 @@ NS_NewResizerFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame);
|
|||
|
||||
#endif
|
||||
|
||||
nsresult
|
||||
NS_NewScrollPortFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame );
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLScrollFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame, PRBool aIsRoot);
|
||||
|
||||
|
@ -3825,11 +3822,11 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresShell* aPresShell,
|
|||
---------------Gfx Scrollbars ------
|
||||
|
||||
|
||||
GfxScrollFrame
|
||||
ScrollFrame
|
||||
|
||||
^
|
||||
|
|
||||
ScrollPort
|
||||
ScrollBox
|
||||
|
||||
^
|
||||
|
|
||||
|
@ -3846,11 +3843,11 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresShell* aPresShell,
|
|||
// Gfx scrollframes were created in the root frame but the primary frame map may have been destroyed if a
|
||||
// new style sheet was loaded so lets reattach the frames to their content.
|
||||
if (mGfxScrollFrame) {
|
||||
nsIFrame* scrollPort = mGfxScrollFrame->GetFirstChild(nsnull);
|
||||
nsIFrame* scrollBox = mGfxScrollFrame->GetFirstChild(nsnull);
|
||||
|
||||
nsIFrame* gfxScrollbarFrame1 = nsnull;
|
||||
nsIFrame* gfxScrollbarFrame2 = nsnull;
|
||||
gfxScrollbarFrame1 = scrollPort->GetNextSibling();
|
||||
gfxScrollbarFrame1 = scrollBox->GetNextSibling();
|
||||
if (gfxScrollbarFrame1) {
|
||||
// XXX This works, but why?
|
||||
aState.mFrameManager->
|
||||
|
@ -4076,11 +4073,11 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell,
|
|||
|
||||
^
|
||||
|
|
||||
GfxScrollFrame
|
||||
ScrollFrame
|
||||
|
||||
^
|
||||
|
|
||||
ScrollPort <--- RootScrollableView
|
||||
ScrollBox <--- RootScrollableView
|
||||
|
||||
^
|
||||
|
|
||||
|
@ -4319,7 +4316,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell,
|
|||
|
||||
// create scrollframe
|
||||
nsIFrame* scrollFrame = nsnull;
|
||||
NS_NewScrollPortFrame(aPresShell, &scrollFrame);
|
||||
NS_NewScrollBoxFrame(aPresShell, &scrollFrame);
|
||||
NS_ENSURE_TRUE(scrollFrame, NS_ERROR_FAILURE);
|
||||
|
||||
scrollFrame->Init(aPresContext, nsnull, parentFrame, scrollPseudoStyle, nsnull);
|
||||
|
@ -6155,24 +6152,15 @@ nsCSSFrameConstructor::FinishBuildingScrollFrame(nsPresContext* aPresContex
|
|||
|
||||
|
||||
/**
|
||||
* Called to wrap a scrollframe or gfx scrollframe around a frame. The hierarchy will look like this
|
||||
* Called to wrap a gfx scrollframe around a frame. The hierarchy will look like this
|
||||
*
|
||||
* ------ for native scrollbars -----
|
||||
* ------- for gfx scrollbars ------
|
||||
*
|
||||
*
|
||||
* ScrollFrame
|
||||
* ^
|
||||
* |
|
||||
* Frame (scrolled frame you passed in)
|
||||
*
|
||||
*
|
||||
* ------- for gfx scrollbars ------
|
||||
*
|
||||
*
|
||||
* GfxScrollFrame
|
||||
* ^
|
||||
* |
|
||||
* ScrollPort
|
||||
* ScrollBox
|
||||
* ^
|
||||
* |
|
||||
* Frame (scrolled frame you passed in)
|
||||
|
@ -6181,17 +6169,9 @@ nsCSSFrameConstructor::FinishBuildingScrollFrame(nsPresContext* aPresContex
|
|||
*-----------------------------------
|
||||
* LEGEND:
|
||||
*
|
||||
* ScrollFrame: This is a frame that has a view that manages native scrollbars. It implements
|
||||
* nsIScrollableView. It also manages clipping and scrolling of native widgets by
|
||||
* having a native scrolling window.
|
||||
*
|
||||
* GfxScrollFrame: This is a frame that manages gfx cross platform frame based scrollbars.
|
||||
*
|
||||
* ScrollPort: This is similar to the ScrollFrame above in that is clips and scrolls its children
|
||||
* with a native scrolling window. But because it is contained in a GfxScrollFrame
|
||||
* it does not have any code to do scrollbars so it is much simpler. Infact it only has
|
||||
* 1 view attached to it. Where the ScrollFrame above has 5!
|
||||
*
|
||||
* ScrollBox: This clips and scrolls its children with a native scrolling window.
|
||||
*
|
||||
* @param aContent the content node of the child to wrap.
|
||||
* @param aScrolledFrame The frame of the content to wrap. This should not be
|
||||
|
@ -6290,10 +6270,10 @@ nsCSSFrameConstructor::InitGfxScrollFrame(nsIPresShell* aPresShell,
|
|||
nsIFrame*& aNewFrame,
|
||||
nsFrameItems& aAnonymousFrames)
|
||||
{
|
||||
nsIFrame* scrollPort;
|
||||
NS_NewScrollPortFrame(aPresShell, &scrollPort);
|
||||
nsIFrame* scrollBox;
|
||||
NS_NewScrollBoxFrame(aPresShell, &scrollBox);
|
||||
|
||||
aAnonymousFrames.AddChild(scrollPort);
|
||||
aAnonymousFrames.AddChild(scrollBox);
|
||||
|
||||
// if there are any anonymous children for the scroll frame, create frames for them.
|
||||
CreateAnonymousFrames(aPresShell, aPresContext, aState, aContent, aDocument, aNewFrame,
|
||||
|
@ -7686,17 +7666,16 @@ nsCSSFrameConstructor::ReconstructDocElementHierarchy(nsPresContext* aPresContex
|
|||
// far, see bugs 70258 and 93558) are:
|
||||
//
|
||||
// (HTML)
|
||||
// ScrollBoxFrame(html)<
|
||||
// ScrollPortFrame(html)<
|
||||
// nsHTMLScrollFrame(html)<
|
||||
// nsScrollBoxFrame(html)<
|
||||
// Canvas(-1)<
|
||||
// Area(html)<
|
||||
// (etc.)
|
||||
//
|
||||
// (XUL #1)
|
||||
// RootBoxFrame(window)<
|
||||
// GfxScroll<
|
||||
// ScrollBoxFrame(window)<
|
||||
// ScrollPortFrame(window)<
|
||||
// nsXULScrollFrame<
|
||||
// nsScrollBoxFrame(window)<
|
||||
// (etc.)
|
||||
//
|
||||
// (XUL #2)
|
||||
|
|
|
@ -1,185 +0,0 @@
|
|||
#
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla 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/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
# for the specific language governing rights and limitations under the
|
||||
# License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Netscape Communications Corporation.
|
||||
# Portions created by the Initial Developer are Copyright (C) 1998
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Prabhat Hegde <prabhat.hegde@sun.com>
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
# in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
# of those above. If you wish to allow use of your version of this file only
|
||||
# under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
# use your version of this file under the terms of the MPL, indicate your
|
||||
# decision by deleting the provisions above and replace them with the notice
|
||||
# and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
# the provisions above, a recipient may use your version of this file under
|
||||
# the terms of any one of the MPL, the GPL or the LGPL.
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
DEPTH = ../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = layout
|
||||
LIBRARY_NAME = gkhtmlbase_s
|
||||
REQUIRES = xpcom \
|
||||
string \
|
||||
dom \
|
||||
content \
|
||||
gfx \
|
||||
widget \
|
||||
locale \
|
||||
view \
|
||||
necko \
|
||||
js \
|
||||
caps \
|
||||
pref \
|
||||
htmlparser \
|
||||
webshell \
|
||||
plugin \
|
||||
docshell \
|
||||
mimetype \
|
||||
webbrwsr \
|
||||
oji \
|
||||
util \
|
||||
unicharutil \
|
||||
lwbrk \
|
||||
imglib2 \
|
||||
accessibility \
|
||||
xpconnect \
|
||||
java \
|
||||
exthandler \
|
||||
intl \
|
||||
uconv \
|
||||
$(NULL)
|
||||
|
||||
# Sun's Complex Text Layout support
|
||||
ifdef SUNCTL
|
||||
REQUIRES += ctl
|
||||
endif
|
||||
|
||||
CPPSRCS = \
|
||||
nsAbsoluteContainingBlock.cpp \
|
||||
nsAreaFrame.cpp \
|
||||
nsBRFrame.cpp \
|
||||
nsBlockBandData.cpp \
|
||||
nsBlockFrame.cpp \
|
||||
nsBlockReflowContext.cpp \
|
||||
nsBlockReflowState.cpp \
|
||||
nsBulletFrame.cpp \
|
||||
nsColumnSetFrame.cpp \
|
||||
nsContainerFrame.cpp \
|
||||
nsFirstLetterFrame.cpp \
|
||||
nsFrame.cpp \
|
||||
nsFrameManager.cpp \
|
||||
nsGfxScrollFrame.cpp \
|
||||
nsHTMLContainerFrame.cpp \
|
||||
nsHTMLFrame.cpp \
|
||||
nsHTMLReflowCommand.cpp \
|
||||
nsHTMLReflowState.cpp \
|
||||
nsImageFrame.cpp \
|
||||
nsImageMap.cpp \
|
||||
nsInlineFrame.cpp \
|
||||
nsLeafFrame.cpp \
|
||||
nsLineBox.cpp \
|
||||
nsLineLayout.cpp \
|
||||
nsObjectFrame.cpp \
|
||||
nsPageFrame.cpp \
|
||||
nsPageContentFrame.cpp \
|
||||
nsPlaceholderFrame.cpp \
|
||||
nsPresShell.cpp \
|
||||
nsScrollPortFrame.cpp \
|
||||
nsSelectsAreaFrame.cpp \
|
||||
nsSimplePageSequence.cpp \
|
||||
nsSpacerFrame.cpp \
|
||||
nsSplittableFrame.cpp \
|
||||
nsReflowPath.cpp \
|
||||
nsTextFrame.cpp \
|
||||
nsTextTransformer.cpp \
|
||||
nsViewportFrame.cpp \
|
||||
$(NULL)
|
||||
ifdef IBMBIDI
|
||||
CPPSRCS += \
|
||||
nsBidiFrames.cpp \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
EXPORTS = \
|
||||
nsILineIterator.h \
|
||||
nsHTMLParts.h \
|
||||
nsIAnonymousContentCreator.h \
|
||||
$(NULL)
|
||||
|
||||
ifdef IBMBIDI
|
||||
EXPORTS += \
|
||||
nsTextTransformer.h \
|
||||
nsBidiFrames.h \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
RESOURCES_HTML = \
|
||||
$(srcdir)/gopher-audio.gif \
|
||||
$(srcdir)/gopher-binary.gif \
|
||||
$(srcdir)/gopher-find.gif \
|
||||
$(srcdir)/gopher-image.gif \
|
||||
$(srcdir)/gopher-menu.gif \
|
||||
$(srcdir)/gopher-movie.gif \
|
||||
$(srcdir)/gopher-sound.gif \
|
||||
$(srcdir)/gopher-telnet.gif \
|
||||
$(srcdir)/gopher-text.gif \
|
||||
$(srcdir)/gopher-unknown.gif \
|
||||
$(NULL)
|
||||
|
||||
RESOURCES = \
|
||||
$(srcdir)/broken-image.gif \
|
||||
$(srcdir)/loading-image.gif \
|
||||
$(NULL)
|
||||
|
||||
|
||||
# we don't want the shared lib, but we want to force the creation of a static lib.
|
||||
FORCE_STATIC_LIB = 1
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
LOCAL_INCLUDES = \
|
||||
-I$(srcdir)/../../../xul/base/src \
|
||||
-I$(srcdir)/../../../xul/content/src \
|
||||
-I$(srcdir)/../../style/src \
|
||||
-I$(srcdir)/../../forms/src \
|
||||
-I$(srcdir)/../../../base/src \
|
||||
-I$(srcdir)/../../../../content/events/src \
|
||||
-I$(srcdir) \
|
||||
$(NULL)
|
||||
|
||||
libs::
|
||||
$(INSTALL) $(RESOURCES_HTML) $(DIST)/bin/res/html
|
||||
$(INSTALL) $(RESOURCES) $(DIST)/bin/res
|
||||
|
||||
install::
|
||||
$(SYSINSTALL) $(IFLAGS1) $(RESOURCES_HTML) $(DESTDIR)$(mozappdir)/res/html
|
||||
$(SYSINSTALL) $(IFLAGS1) $(RESOURCES) $(DESTDIR)$(mozappdir)/res
|
||||
|
||||
DEFINES += -D_IMPL_NS_LAYOUT
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -70,7 +70,6 @@
|
|||
#include "nsIDOMNSDocument.h"
|
||||
#include "nsPIBoxObject.h"
|
||||
#include "nsINodeInfo.h"
|
||||
#include "nsScrollPortFrame.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
|
||||
/////////////// nsListScrollSmoother //////////////////
|
||||
|
|
|
@ -228,7 +228,7 @@ nsListBoxObject::GetListBoxBody()
|
|||
if (!frame)
|
||||
return nsnull;
|
||||
|
||||
// this frame will be a nsListBoxScrollPortFrame
|
||||
// this frame will be a nsScrollBoxFrame
|
||||
nsIFrame* scrollPort = frame->GetFirstChild(nsnull);
|
||||
if (!scrollPort)
|
||||
return nsnull;
|
||||
|
|
|
@ -53,6 +53,8 @@
|
|||
#include "nsLayoutAtoms.h"
|
||||
#include "nsBoxLayoutState.h"
|
||||
#include "nsIScrollbarMediator.h"
|
||||
#include "nsIFormControlFrame.h"
|
||||
#include "nsGfxScrollFrame.h"
|
||||
#include "nsXPCOM.h"
|
||||
#include "nsISupportsPrimitives.h"
|
||||
#include "nsIPresState.h"
|
||||
|
@ -84,10 +86,36 @@ nsScrollBoxFrame::nsScrollBoxFrame(nsIPresShell* aShell):nsBoxFrame(aShell), mVe
|
|||
{
|
||||
}
|
||||
|
||||
|
||||
PRBool
|
||||
nsScrollBoxFrame::NeedsClipWidget()
|
||||
{
|
||||
// Scrollports contained in form controls (e.g., listboxes) don't get
|
||||
// widgets.
|
||||
for (nsIFrame* parentFrame = GetParent(); parentFrame;
|
||||
parentFrame = parentFrame->GetParent()) {
|
||||
nsIFormControlFrame* fcFrame;
|
||||
if ((NS_SUCCEEDED(parentFrame->QueryInterface(NS_GET_IID(nsIFormControlFrame), (void**)&fcFrame)))) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
// Scrollports that don't ever show associated scrollbars don't get
|
||||
// widgets, because they will seldom actually be scrolled.
|
||||
nsIFrame* parent = GetParent();
|
||||
if (!parent)
|
||||
return nsnull;
|
||||
nsCOMPtr<nsIScrollableFrame> scrollFrame = do_QueryInterface(parent);
|
||||
if (scrollFrame) {
|
||||
nsGfxScrollFrameInner::ScrollbarStyles scrollbars
|
||||
= scrollFrame->GetScrollbarStyles();
|
||||
if ((scrollbars.mHorizontal == NS_STYLE_OVERFLOW_HIDDEN
|
||||
|| scrollbars.mHorizontal == NS_STYLE_OVERFLOW_VISIBLE)
|
||||
&& (scrollbars.mVertical == NS_STYLE_OVERFLOW_HIDDEN
|
||||
|| scrollbars.mVertical == NS_STYLE_OVERFLOW_VISIBLE)) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -62,7 +62,6 @@ public:
|
|||
}
|
||||
#endif
|
||||
|
||||
|
||||
// nsIFrame overrides
|
||||
NS_IMETHOD AttributeChanged(nsPresContext* aPresContext,
|
||||
nsIContent* aChild,
|
||||
|
|
Загрузка…
Ссылка в новой задаче