Hello community,
here is the log from the commit of package mozilla-xulrunner190
checked in at Mon Apr 21 01:28:57 CEST 2008.
--------
--- mozilla-xulrunner190/mozilla-xulrunner190.changes 2008-04-14 19:09:25.000000000 +0200
+++ mozilla-xulrunner190/mozilla-xulrunner190.changes 2008-04-16 21:30:25.065607000 +0200
@@ -1,0 +2,10 @@
+Wed Apr 16 17:07:02 CEST 2008 - maw@suse.de
+
+- Merge changes from the build service:
+ + Add mozilla-chrome-registry.patch to fix a startup crash
+ (bmo#391311 and bnc#379523)
+ + Add mozilla-scroll.patch to fix scrolling performance issues
+ (bmo#424915 and bnc#377055)
+ + Update baselibs.conf.
+
+-------------------------------------------------------------------
New:
----
mozilla-chrome-registry.patch
mozilla-scroll.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ mozilla-xulrunner190.spec ++++++
--- /var/tmp/diff_new_pack.I20395/_old 2008-04-21 01:26:23.000000000 +0200
+++ /var/tmp/diff_new_pack.I20395/_new 2008-04-21 01:26:23.000000000 +0200
@@ -18,7 +18,7 @@
%endif
License: GPL v2 or later; LGPL v2.1 or later; MOZILLA PUBLIC LICENSE (MPL/NPL)
Version: 1.8.99.5
-Release: 6
+Release: 9
Summary: Mozilla Runtime Environment 1.9
Url: http://www.mozilla.org
Group: Productivity/Other
@@ -33,6 +33,8 @@
Patch3: mozilla-dpi-scaling.patch
Patch4: idldir.patch
Patch5: mozilla-path_len.patch
+Patch6: mozilla-chrome-registry.patch
+Patch7: mozilla-scroll.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
PreReq: libstdc++ expat pango xorg-x11-libs fontconfig freetype2
PreReq: gtk2 atk glib2 update-alternatives coreutils
@@ -139,6 +141,8 @@
%patch3
%patch4
%patch5 -p1
+%patch6
+%patch7
%build
MOZ_APP_DIR=%{_libdir}/%{name}-%{version_internal}
@@ -384,6 +388,13 @@
%endif
%changelog
+* Wed Apr 16 2008 maw@suse.de
+- Merge changes from the build service:
+ + Add mozilla-chrome-registry.patch to fix a startup crash
+ (bmo#391311 and bnc#379523)
+ + Add mozilla-scroll.patch to fix scrolling performance issues
+ (bmo#424915 and bnc#377055)
+ + Update baselibs.conf.
* Mon Apr 14 2008 maw@suse.de
- Better sync against the build service's version.
* Thu Apr 10 2008 ro@suse.de
++++++ baselibs.conf ++++++
--- mozilla-xulrunner190/baselibs.conf 2008-04-10 10:37:29.000000000 +0200
+++ mozilla-xulrunner190/baselibs.conf 2008-04-16 21:30:36.902764000 +0200
@@ -1,5 +1,6 @@
mozilla-xulrunner190
+/usr/lib(64)?/xulrunner-.*
+ +/etc/gre.d/.*
mozilla-xulrunner190-lang
+/usr/lib(64)?/xulrunner-.*
++++++ mozilla-chrome-registry.patch ++++++
From: upstream (in 3.0rc1)
Subject: Topcrash: [@ nsChromeRegistry::CheckForNewChrome] during startup
crash [@ nsFrame::BoxReflow] at start of page rendering
References:
https://bugzilla.mozilla.org/show_bug.cgi?id=391311
https://bugzilla.mozilla.org/show_bug.cgi?id=292549
Index: chrome/src/nsChromeRegistry.cpp
===================================================================
RCS file: /cvsroot/mozilla/chrome/src/nsChromeRegistry.cpp,v
retrieving revision 1.365
diff -u -1 -2 -p -d -r1.365 nsChromeRegistry.cpp
--- chrome/src/nsChromeRegistry.cpp 7 Mar 2008 01:20:44 -0000 1.365
+++ chrome/src/nsChromeRegistry.cpp 19 Mar 2008 16:17:51 -0000
@@ -81,24 +81,25 @@
#include "nsIDirectoryService.h"
#include "nsIDocument.h"
#include "nsIDOMDocument.h"
#include "nsIDocShell.h"
#include "nsIDocumentObserver.h"
#include "nsIDOMElement.h"
#include "nsIDOMLocation.h"
#include "nsIDOMWindowCollection.h"
#include "nsIDOMWindowInternal.h"
#include "nsIFileChannel.h"
#include "nsIFileURL.h"
#include "nsIIOService.h"
+#include "nsIJARProtocolHandler.h"
#include "nsIJARURI.h"
#include "nsILocalFile.h"
#include "nsILocaleService.h"
#include "nsILookAndFeel.h"
#include "nsIObserverService.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
#include "nsIPrefBranch2.h"
#include "nsIPresShell.h"
#include "nsIProtocolHandler.h"
#include "nsIResProtocolHandler.h"
#include "nsIScriptError.h"
@@ -478,24 +479,40 @@ nsChromeRegistry::Init()
static const nsStaticAtom atoms[] = {
{ "chrome", nsnull },
{ "NC", nsnull },
{ "allowScripts", nsnull },
{ "package", nsnull },
{ "packages", nsnull },
{ "hasOverlays", nsnull },
};
NS_RegisterStaticAtoms(atoms, NS_ARRAY_LENGTH(atoms));
+ // Check to see if necko and the JAR protocol handler are registered yet
+ // if not, somebody is doing work during XPCOM registration that they
+ // shouldn't be doing. See bug 292549, where JS components are trying
+ // to call Components.utils.import("chrome:///") early in registration
+
+ nsCOMPtr<nsIIOService> io (do_GetIOService());
+ if (!io) return NS_ERROR_FAILURE;
+
+ nsCOMPtr<nsIProtocolHandler> ph;
+ rv = io->GetProtocolHandler("jar", getter_AddRefs(ph));
+ NS_ENSURE_SUCCESS(rv, rv);
+
+ nsCOMPtr<nsIJARProtocolHandler> jph = do_QueryInterface(ph);
+ if (!jph)
+ return NS_ERROR_NOT_INITIALIZED;
+
if (!PL_DHashTableInit(&mPackagesHash, &kTableOps,
nsnull, sizeof(PackageEntry), 16))
return NS_ERROR_FAILURE;
if (!mOverlayHash.Init() ||
!mStyleHash.Init() ||
!mOverrideTable.Init())
return NS_ERROR_FAILURE;
mSelectedLocale = NS_LITERAL_CSTRING("en-US");
mSelectedSkin = NS_LITERAL_CSTRING("classic/1.0");
@@ -1136,24 +1153,25 @@ nsChromeRegistry::CheckForNewChrome()
mOverrideTable.Clear();
nsCOMPtr<nsIURI> manifestURI;
rv = NS_NewURI(getter_AddRefs(manifestURI),
NS_LITERAL_CSTRING("resource:///chrome/app-chrome.manifest"));
// this is the main manifest; if it doesn't exist we generate it from
// installed-chrome.txt. When the build system learns about the new system,
// this code can go away.
nsCOMPtr<nsIFileURL> manifestFileURL (do_QueryInterface(manifestURI));
NS_ASSERTION(manifestFileURL, "Not a nsIFileURL!");
+ NS_ENSURE_TRUE(manifestFileURL, NS_ERROR_UNEXPECTED);
nsCOMPtr<nsIFile> manifest;
manifestFileURL->GetFile(getter_AddRefs(manifest));
NS_ENSURE_TRUE(manifest, NS_ERROR_FAILURE);
PRBool exists;
rv = manifest->Exists(&exists);
NS_ENSURE_SUCCESS(rv, rv);
#ifdef DEBUG
// In debug builds, installed-chrome.txt may change during development;
// we just rebuild it every time because we're not worried about startup
More bug 391311 - If the chrome registry didn't initialize all the way sucessfully, the destructor should be careful to clean up correctly.
diff --git a/chrome/src/nsChromeRegistry.cpp b/chrome/src/nsChromeRegistry.cpp
--- chrome/src/nsChromeRegistry.cpp
+++ chrome/src/nsChromeRegistry.cpp
@@ -430,7 +430,8 @@ nsChromeRegistry::OverlayListHash::GetAr
nsChromeRegistry::~nsChromeRegistry()
{
- PL_DHashTableFinish(&mPackagesHash);
+ if (mPackagesHash.ops)
+ PL_DHashTableFinish(&mPackagesHash);
gChromeRegistry = nsnull;
}
diff --git a/chrome/src/nsChromeRegistry.h b/chrome/src/nsChromeRegistry.h
--- chrome/src/nsChromeRegistry.h
+++ chrome/src/nsChromeRegistry.h
@@ -94,7 +94,9 @@ public:
NS_DECL_NSIOBSERVER
// nsChromeRegistry methods:
- nsChromeRegistry() : mInitialized(PR_FALSE) { }
+ nsChromeRegistry() : mInitialized(PR_FALSE) {
+ mPackagesHash.ops = nsnull;
+ }
~nsChromeRegistry();
nsresult Init();
++++++ mozilla-scroll.patch ++++++
diff -NrpU12 mozilla-trunk.7e534b97497a/layout/base/nsDisplayList.cpp mozilla-trunk/layout/base/nsDisplayList.cpp
--- layout/base/nsDisplayList.cpp 2008-03-31 15:09:19.000000000 +1000
+++ layout/base/nsDisplayList.cpp 2008-03-31 15:09:19.000000000 +1000
@@ -43,27 +43,27 @@
*/
#include "nsDisplayList.h"
#include "nsCSSRendering.h"
#include "nsISelectionController.h"
#include "nsIPresShell.h"
#include "nsRegion.h"
#include "nsFrameManager.h"
#include "gfxContext.h"
nsDisplayListBuilder::nsDisplayListBuilder(nsIFrame* aReferenceFrame,
- PRBool aIsForEvents, PRBool aBuildCaret, nsIFrame* aMovingFrame)
+ PRBool aIsForEvents, PRBool aBuildCaret)
: mReferenceFrame(aReferenceFrame),
- mMovingFrame(aMovingFrame),
+ mMovingFrame(nsnull),
mIgnoreScrollFrame(nsnull),
mBuildCaret(aBuildCaret),
mEventDelivery(aIsForEvents),
mIsAtRootOfPseudoStackingContext(PR_FALSE),
mPaintAllFrames(PR_FALSE) {
PL_InitArenaPool(&mPool, "displayListArena", 1024, sizeof(void*)-1);
nsPresContext* pc = aReferenceFrame->PresContext();
nsIPresShell *shell = pc->PresShell();
PRBool suppressed;
shell->IsPaintingSuppressed(&suppressed);
mIsBackgroundOnly = suppressed;
@@ -222,41 +222,40 @@ void nsDisplayListSet::MoveTo(const nsDi
aDestination.Content()->AppendToTop(Content());
aDestination.PositionedDescendants()->AppendToTop(PositionedDescendants());
aDestination.Outlines()->AppendToTop(Outlines());
}
// Suitable for leaf items only, overridden by nsDisplayWrapList
PRBool
nsDisplayItem::OptimizeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion) {
nsRect bounds = GetBounds(aBuilder);
if (!aVisibleRegion->Intersects(bounds))
return PR_FALSE;
-
+
nsIFrame* f = GetUnderlyingFrame();
NS_ASSERTION(f, "GetUnderlyingFrame() must return non-null for leaf items");
- if (aBuilder->HasMovingFrames() && aBuilder->IsMovingFrame(f)) {
- // If this frame is in the moving subtree, and it doesn't
- // require repainting just because it's moved, then just remove it now
- // because it's not relevant.
- if (!IsVaryingRelativeToFrame(aBuilder, aBuilder->GetRootMovingFrame()))
- return PR_FALSE;
- // keep it, but don't let it cover other display items (see nsLayoutUtils::
- // ComputeRepaintRegionForCopy)
- return PR_TRUE;
- }
+ PRBool isMoving = aBuilder->IsMovingFrame(f);
if (IsOpaque(aBuilder)) {
- aVisibleRegion->SimpleSubtract(bounds);
+ nsRect opaqueArea = bounds;
+ if (isMoving) {
+ // The display list should include items for both the before and after
+ // states. So the only area we want to cover is the the area that
+ // was opaque in the before state and in the after state.
+ opaqueArea.IntersectRect(bounds - aBuilder->GetMoveDelta(), bounds);
+ }
+ aVisibleRegion->SimpleSubtract(opaqueArea);
}
+
return PR_TRUE;
}
void
nsDisplayList::FlattenTo(nsTArray* aElements) {
nsDisplayItem* item;
while ((item = RemoveBottom()) != nsnull) {
if (item->GetType() == nsDisplayItem::TYPE_WRAPLIST) {
item->GetList()->FlattenTo(aElements);
item->~nsDisplayItem();
} else {
aElements->AppendElement(item);
@@ -498,47 +497,47 @@ nsDisplayBackground::IsUniform(nsDisplay
PRBool hasBG =
nsCSSRendering::FindBackground(mFrame->PresContext(), mFrame, &bg, &isCanvas);
if (!hasBG)
return PR_TRUE;
if ((bg->mBackgroundFlags & NS_STYLE_BG_IMAGE_NONE) &&
!nsLayoutUtils::HasNonZeroSide(mFrame->GetStyleBorder()->mBorderRadius) &&
bg->mBackgroundClip == NS_STYLE_BG_CLIP_BORDER)
return PR_TRUE;
return PR_FALSE;
}
PRBool
-nsDisplayBackground::IsVaryingRelativeToFrame(nsDisplayListBuilder* aBuilder,
- nsIFrame* aAncestorFrame)
+nsDisplayBackground::IsVaryingRelativeToMovingFrame(nsDisplayListBuilder* aBuilder)
{
+ NS_ASSERTION(aBuilder->IsMovingFrame(mFrame),
+ "IsVaryingRelativeToMovingFrame called on non-moving frame!");
+
+ nsPresContext* presContext = mFrame->PresContext();
PRBool isCanvas;
const nsStyleBackground* bg;
PRBool hasBG =
- nsCSSRendering::FindBackground(mFrame->PresContext(), mFrame, &bg, &isCanvas);
+ nsCSSRendering::FindBackground(presContext, mFrame, &bg, &isCanvas);
if (!hasBG)
return PR_FALSE;
if (!bg->HasFixedBackground())
return PR_FALSE;
- // aAncestorFrame is the frame that is going to be moved.
- // Check if mFrame is equal to aAncestorFrame or aAncestorFrame is an
- // ancestor of mFrame in the same document. If this is true, mFrame
+ nsIFrame* movingFrame = aBuilder->GetRootMovingFrame();
+ // movingFrame is the frame that is going to be moved. It must be equal
+ // to mFrame or some ancestor of mFrame, see assertion above.
+ // If mFrame is in the same document as movingFrame, then mFrame
// will move relative to its viewport, which means this display item will
- // change when it is moved. If they are in different documents, we do not
+ // change when it is moved. If they are in different documents, we do not
// want to return true because mFrame won't move relative to its viewport.
- for (nsIFrame* f = mFrame; f; f = f->GetParent()) {
- if (f == aAncestorFrame)
- return PR_TRUE;
- }
- return PR_FALSE;
+ return movingFrame->PresContext() == presContext;
}
void
nsDisplayBackground::Paint(nsDisplayListBuilder* aBuilder,
nsIRenderingContext* aCtx, const nsRect& aDirtyRect) {
nsPoint offset = aBuilder->ToReferenceFrame(mFrame);
nsCSSRendering::PaintBackground(mFrame->PresContext(), *aCtx, mFrame,
aDirtyRect, nsRect(offset, mFrame->GetSize()),
*mFrame->GetStyleBorder(),
*mFrame->GetStylePadding(),
mFrame->HonorPrintBackgroundSettings());
}
@@ -668,31 +667,27 @@ nsDisplayWrapList::OptimizeVisibility(ns
PRBool
nsDisplayWrapList::IsOpaque(nsDisplayListBuilder* aBuilder) {
// We could try to do something but let's conservatively just return PR_FALSE.
// We reimplement OptimizeVisibility and that's what really matters
return PR_FALSE;
}
PRBool nsDisplayWrapList::IsUniform(nsDisplayListBuilder* aBuilder) {
// We could try to do something but let's conservatively just return PR_FALSE.
return PR_FALSE;
}
-PRBool nsDisplayWrapList::IsVaryingRelativeToFrame(nsDisplayListBuilder* aBuilder,
- nsIFrame* aFrame) {
- for (nsDisplayItem* i = mList.GetBottom(); i != nsnull; i = i->GetAbove()) {
- if (i->IsVaryingRelativeToFrame(aBuilder, aFrame))
- return PR_TRUE;
- }
- return PR_FALSE;
+PRBool nsDisplayWrapList::IsVaryingRelativeToMovingFrame(nsDisplayListBuilder* aBuilder) {
+ // We could try to do something but let's conservatively just return PR_TRUE.
+ return PR_TRUE;
}
void nsDisplayWrapList::Paint(nsDisplayListBuilder* aBuilder,
nsIRenderingContext* aCtx, const nsRect& aDirtyRect) {
mList.Paint(aBuilder, aCtx, aDirtyRect);
}
static nsresult
WrapDisplayList(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
nsDisplayList* aList, nsDisplayWrapper* aWrapper) {
if (!aList->GetTop())
return NS_OK;
diff -NrpU12 mozilla-trunk.7e534b97497a/layout/base/nsDisplayList.h mozilla-trunk/layout/base/nsDisplayList.h
--- layout/base/nsDisplayList.h 2008-03-31 15:09:19.000000000 +1000
+++ layout/base/nsDisplayList.h 2008-03-31 15:09:19.000000000 +1000
@@ -123,53 +123,65 @@ public:
* is the origin of the reference coordinate system for this display list
* @param aIsForEvents PR_TRUE if we're creating this list in order to
* determine which frame is under the mouse position
* @param aBuildCaret whether or not we should include the caret in any
* display lists that we make.
* @param aMovingFrame a frame whose subtree should be regarded as
* moving; moving frames are not allowed to clip or cover (during
* OptimizeVisibility) non-moving frames. E.g. when we're constructing
* a display list to see what should be repainted during a scroll
* operation, we specify the scrolled frame as the moving frame.
*/
nsDisplayListBuilder(nsIFrame* aReferenceFrame, PRBool aIsForEvents,
- PRBool aBuildCaret, nsIFrame* aMovingFrame = nsnull);
+ PRBool aBuildCaret);
~nsDisplayListBuilder();
/**
* @return PR_TRUE if the display is being built in order to determine which
* frame is under the mouse position.
*/
PRBool IsForEventDelivery() { return mEventDelivery; }
/**
* @return PR_TRUE if "painting is suppressed" during page load and we
* should paint only the background of the document.
*/
PRBool IsBackgroundOnly() { return mIsBackgroundOnly; }
/**
* @return PR_TRUE if the currently active BuildDisplayList call is being
* applied to a frame at the root of a pseudo stacking context. A pseudo
* stacking context is either a real stacking context or basically what
* CSS2.1 appendix E refers to with "treat the element as if it created
* a new stacking context
*/
PRBool IsAtRootOfPseudoStackingContext() { return mIsAtRootOfPseudoStackingContext; }
+
+ /**
+ * Indicate that we'll use this display list to analyze the effects
+ * of aMovingFrame moving by aMoveDelta. The move has already been
+ * applied to the frame tree.
+ */
+ void SetMovingFrame(nsIFrame* aMovingFrame, const nsPoint& aMoveDelta) {
+ mMovingFrame = aMovingFrame;
+ mMoveDelta = aMoveDelta;
+ }
+
/**
* @return PR_TRUE if we are doing analysis of moving frames
*/
PRBool HasMovingFrames() { return mMovingFrame != nsnull; }
/**
* @return the frame that is being hypothetically moved
*/
nsIFrame* GetRootMovingFrame() { return mMovingFrame; }
+ const nsPoint& GetMoveDelta() { return mMoveDelta; }
/**
* @return PR_TRUE if aFrame is, or is a descendant of, the hypothetical
* moving frame
*/
PRBool IsMovingFrame(nsIFrame* aFrame) {
return aFrame == mMovingFrame || (mMovingFrame &&
nsLayoutUtils::IsProperAncestorFrameCrossDoc(mMovingFrame, aFrame, mReferenceFrame));
}
/**
* @return the selection that painting should be restricted to (or nsnull
* in the normal unrestricted case)
*/
@@ -291,24 +303,25 @@ private:
nsIFrame* mCaretFrame;
PRUint32 mFirstFrameMarkedForDisplay;
};
PresShellState* CurrentPresShellState() {
NS_ASSERTION(mPresShellStates.Length() > 0,
"Someone forgot to enter a presshell");
return &mPresShellStates[mPresShellStates.Length() - 1];
}
nsIFrame* mReferenceFrame;
nsIFrame* mMovingFrame;
nsIFrame* mIgnoreScrollFrame;
+ nsPoint mMoveDelta; // only valid when mMovingFrame is non-null
PLArenaPool mPool;
nsCOMPtr<nsISelection> mBoundingSelection;
nsAutoTArray mPresShellStates;
nsAutoTArray mFramesMarkedForDisplay;
PRPackedBool mBuildCaret;
PRPackedBool mEventDelivery;
PRPackedBool mIsBackgroundOnly;
PRPackedBool mIsAtRootOfPseudoStackingContext;
PRPackedBool mPaintAllFrames;
};
class nsDisplayItem;
@@ -411,29 +424,29 @@ public:
/**
* @return PR_TRUE if the item is definitely opaque --- i.e., paints
* every pixel within its bounds opaquely
*/
virtual PRBool IsOpaque(nsDisplayListBuilder* aBuilder) { return PR_FALSE; }
/**
* @return PR_TRUE if the item is guaranteed to paint every pixel in its
* bounds with the same (possibly translucent) color
*/
virtual PRBool IsUniform(nsDisplayListBuilder* aBuilder) { return PR_FALSE; }
/**
* @return PR_FALSE if the painting performed by the item is invariant
- * when frame aFrame is moved relative to its parent (so it would be safe
- * to update the display by just copying pixels from their old to new location)
+ * when frame aFrame is moved relative to aBuilder->GetRootMovingFrame().
+ * This can only be called when aBuilder->IsMovingFrame(mFrame) is true.
+ * It return PR_TRUE for all wrapped lists.
*/
- virtual PRBool IsVaryingRelativeToFrame(nsDisplayListBuilder* aBuilder,
- nsIFrame* aFrame) { return PR_FALSE; }
+ virtual PRBool IsVaryingRelativeToMovingFrame(nsDisplayListBuilder* aBuilder) { return PR_FALSE; }
/**
* Actually paint this item to some rendering context.
* @param aDirtyRect relative to aBuilder->ReferenceFrame()
*/
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect) {}
/**
* Only to be (re)implemented by items that contain child display lists.
* Do not reimplement for leaf items.
* The default implementation calls GetBounds() and IsOpaque().
* On entry, aVisibleRegion contains the region (relative to ReferenceFrame())
@@ -981,26 +994,25 @@ public:
mIsThemed = mFrame->IsThemed();
MOZ_COUNT_CTOR(nsDisplayBackground);
}
#ifdef NS_BUILD_REFCNT_LOGGING
virtual ~nsDisplayBackground() {
MOZ_COUNT_DTOR(nsDisplayBackground);
}
#endif
virtual nsIFrame* HitTest(nsDisplayListBuilder* aBuilder, nsPoint aPt,
HitTestState* aState) { return mFrame; }
virtual PRBool IsOpaque(nsDisplayListBuilder* aBuilder);
- virtual PRBool IsVaryingRelativeToFrame(nsDisplayListBuilder* aBuilder,
- nsIFrame* aAncestorFrame);
+ virtual PRBool IsVaryingRelativeToMovingFrame(nsDisplayListBuilder* aBuilder);
virtual PRBool IsUniform(nsDisplayListBuilder* aBuilder);
virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder);
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect);
NS_DISPLAY_DECL_NAME("Background")
private:
/* Used to cache mFrame->IsThemed() since it isn't a cheap call */
PRPackedBool mIsThemed;
};
/**
* The standard display item to paint the CSS outline of a frame.
@@ -1065,26 +1077,25 @@ public:
/**
* Takes all the items from aList and puts them in our list.
*/
nsDisplayWrapList(nsIFrame* aFrame, nsDisplayList* aList);
nsDisplayWrapList(nsIFrame* aFrame, nsDisplayItem* aItem);
virtual ~nsDisplayWrapList();
virtual Type GetType() { return TYPE_WRAPLIST; }
virtual nsIFrame* HitTest(nsDisplayListBuilder* aBuilder, nsPoint aPt,
HitTestState* aState);
virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder);
virtual PRBool IsOpaque(nsDisplayListBuilder* aBuilder);
virtual PRBool IsUniform(nsDisplayListBuilder* aBuilder);
- virtual PRBool IsVaryingRelativeToFrame(nsDisplayListBuilder* aBuilder,
- nsIFrame* aFrame);
+ virtual PRBool IsVaryingRelativeToMovingFrame(nsDisplayListBuilder* aBuilder);
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect);
virtual PRBool OptimizeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion);
virtual PRBool TryMerge(nsDisplayListBuilder* aBuilder, nsDisplayItem* aItem) {
NS_WARNING("This list should already have been flattened!!!");
return PR_FALSE;
}
NS_DISPLAY_DECL_NAME("WrapList")
virtual nsDisplayList* GetList() { return &mList; }
diff -NrpU12 mozilla-trunk.7e534b97497a/layout/base/nsLayoutDebugger.cpp mozilla-trunk/layout/base/nsLayoutDebugger.cpp
--- layout/base/nsLayoutDebugger.cpp 2008-03-31 15:09:19.000000000 +1000
+++ layout/base/nsLayoutDebugger.cpp 2008-03-31 15:09:19.000000000 +1000
@@ -168,29 +168,32 @@ PrintDisplayListTo(nsDisplayListBuilder*
fDebug->GetFrameName(fName);
}
nsRect rect = i->GetBounds(aBuilder);
switch (i->GetType()) {
case nsDisplayItem::TYPE_CLIP: {
nsDisplayClip* c = static_cast(i);
rect = c->GetClipRect();
break;
}
default:
break;
}
- fprintf(aOutput, "%s %p(%s) (%d,%d,%d,%d)%s%s\n", i->Name(),
+ fprintf(aOutput, "%s %p(%s) (%d,%d,%d,%d)%s%s%s%s\n", i->Name(),
(void*)f, NS_ConvertUTF16toUTF8(fName).get(),
rect.x, rect.y, rect.width, rect.height,
i->IsOpaque(aBuilder) ? " opaque" : "",
- i->IsUniform(aBuilder) ? " uniform" : "");
+ i->IsUniform(aBuilder) ? " uniform" : "",
+ f && aBuilder->IsMovingFrame(f) ? " moving" : "",
+ f && aBuilder->IsMovingFrame(f) && !i->GetList() &&
+ i->IsVaryingRelativeToMovingFrame(aBuilder) ? " varying" : "");
nsDisplayList* list = i->GetList();
if (list) {
PrintDisplayListTo(aBuilder, *list, aIndent + 4, aOutput);
}
}
}
void
nsIFrameDebug::PrintDisplayList(nsDisplayListBuilder* aBuilder, const nsDisplayList& aList)
{
PrintDisplayListTo(aBuilder, aList, 0, stderr);
}
diff -NrpU12 mozilla-trunk.7e534b97497a/layout/base/nsLayoutUtils.cpp mozilla-trunk/layout/base/nsLayoutUtils.cpp
--- layout/base/nsLayoutUtils.cpp 2008-03-31 15:09:19.000000000 +1000
+++ layout/base/nsLayoutUtils.cpp 2008-03-31 15:09:19.000000000 +1000
@@ -903,39 +903,37 @@ AddItemsToRegion(nsDisplayListBuilder* a
for (nsDisplayItem* item = aList->GetBottom(); item; item = item->GetAbove()) {
nsDisplayList* sublist = item->GetList();
if (sublist) {
if (item->GetType() == nsDisplayItem::TYPE_CLIP) {
nsRect clip;
clip.IntersectRect(aClipRect, static_cast(item)->GetClipRect());
AddItemsToRegion(aBuilder, sublist, aRect, clip, aDelta, aRegion);
} else {
// opacity, or a generic sublist
AddItemsToRegion(aBuilder, sublist, aRect, aClipRect, aDelta, aRegion);
}
} else {
- // Items left in the list are either IsVaryingRelativeToFrame
- // or !IsMovingFrame (i.e., not in the moving subtree)
nsRect r;
if (r.IntersectRect(aClipRect, item->GetBounds(aBuilder))) {
- PRBool inMovingSubtree = PR_FALSE;
- if (item->IsVaryingRelativeToFrame(aBuilder, aBuilder->GetRootMovingFrame())) {
- nsIFrame* f = item->GetUnderlyingFrame();
- NS_ASSERTION(f, "Must have an underlying frame for leaf item");
- inMovingSubtree = aBuilder->IsMovingFrame(f);
- AccumulateItemInRegion(aRegion, aRect + aDelta, r, item);
- }
-
- if (!inMovingSubtree) {
- // if it's uniform and it includes both the old and new areas, then
- // we don't need to paint it
+ nsIFrame* f = item->GetUnderlyingFrame();
+ NS_ASSERTION(f, "Must have an underlying frame for leaf item");
+ if (aBuilder->IsMovingFrame(f)) {
+ if (item->IsVaryingRelativeToMovingFrame(aBuilder)) {
+ // something like background-attachment:fixed that varies
+ // its drawing when it moves
+ AccumulateItemInRegion(aRegion, aRect + aDelta, r, item);
+ }
+ } else {
+ // not moving. If it's uniform and it includes both the old and
+ // new areas, then we don't need to paint it
PRBool skip = r.Contains(aRect) && r.Contains(aRect + aDelta) &&
item->IsUniform(aBuilder);
if (!skip) {
// area where a non-moving element is visible must be repainted
AccumulateItemInRegion(aRegion, aRect + aDelta, r, item);
// we may have bitblitted an area that was painted by a non-moving
// element. This bitblitted data is invalid and was copied to
// "r + aDelta".
AccumulateItemInRegion(aRegion, aRect + aDelta, r + aDelta, item);
}
}
}
@@ -945,33 +943,37 @@ AddItemsToRegion(nsDisplayListBuilder* a
nsresult
nsLayoutUtils::ComputeRepaintRegionForCopy(nsIFrame* aRootFrame,
nsIFrame* aMovingFrame,
nsPoint aDelta,
const nsRect& aCopyRect,
nsRegion* aRepaintRegion)
{
NS_ASSERTION(aRootFrame != aMovingFrame,
"The root frame shouldn't be the one that's moving, that makes no sense");
// Build the 'after' display list over the whole area of interest.
- // Frames under aMovingFrame will not be allowed to affect (clip or cover)
- // non-moving frame display items ... then we can be sure the non-moving
- // frame display items we get are the same ones we would have gotten if
- // we had constructed the 'before' display list.
// (We have to build the 'after' display list because the frame/view
- // hierarchy has already been updated for the move.)
+ // hierarchy has already been updated for the move.
+ // We need to ensure that the non-moving frame display items we get
+ // are the same ones we would have gotten if we had constructed the
+ // 'before' display list. So opaque moving items are only considered to
+ // cover the intersection of their old and new bounds (see
+ // nsDisplayItem::OptimizeVisibility). A moving clip item is not allowed
+ // to clip non-moving items --- this is enforced by the code that sets
+ // up nsDisplayClip items, in particular see ApplyAbsPosClipping.
nsRect rect;
rect.UnionRect(aCopyRect, aCopyRect + aDelta);
- nsDisplayListBuilder builder(aRootFrame, PR_FALSE, PR_TRUE, aMovingFrame);
+ nsDisplayListBuilder builder(aRootFrame, PR_FALSE, PR_TRUE);
+ builder.SetMovingFrame(aMovingFrame, aDelta);
nsDisplayList list;
builder.EnterPresShell(aRootFrame, rect);
nsresult rv =
aRootFrame->BuildDisplayListForStackingContext(&builder, rect, &list);
builder.LeavePresShell(aRootFrame, rect);
NS_ENSURE_SUCCESS(rv, rv);
#ifdef DEBUG
if (gDumpRepaintRegionForCopy) {
diff -NrpU12 mozilla-trunk.7e534b97497a/layout/base/nsLayoutUtils.h mozilla-trunk/layout/base/nsLayoutUtils.h
--- layout/base/nsLayoutUtils.h 2008-03-31 15:09:19.000000000 +1000
+++ layout/base/nsLayoutUtils.h 2008-03-31 15:09:19.000000000 +1000
@@ -410,27 +410,35 @@ public:
* @param aPt the amount by which aMovingFrame has moved and the rect will
* be copied
* @param aCopyRect a rectangle that will be copied, relative to aRootFrame
* @param aRepaintRegion a subregion of aCopyRect+aDelta that must be repainted
* after doing the bitblt
*
* Ideally this function would actually have the rect-to-copy as an output
* rather than an input, but for now, scroll bitblitting is limited to
* the whole of a single widget, so we cannot choose the rect.
*
* This function assumes that the caller will do a bitblt copy of aCopyRect
* to aCopyRect+aPt. It computes a region that must be repainted in order
- * for the resulting rendering to be correct.
+ * for the resulting rendering to be correct. Frame geometry must have
+ * already been adjusted for the scroll/copy operation.
*
- * The region consists of:
+ * Conceptually it works by computing a display list in the before-state
+ * and a display list in the after-state and analyzing them to find the
+ * differences. In practice it is only feasible to build a display list
+ * in the after-state (plus building two display lists would be less
+ * efficient), so we use some unfortunately tricky techniques to get by
+ * with just the after-list.
+ *
+ * The output region consists of:
* a) any visible background-attachment:fixed areas in the after-move display
* list
* b) any visible areas of the before-move display list corresponding to
* frames that will not move (translated by aDelta)
* c) any visible areas of the after-move display list corresponding to
* frames that did not move
* d) except that if the same display list element is visible in b) and c)
* for a frame that did not move and paints a uniform color within its
* bounds, then the intersection of its old and new bounds can be excluded
* when it is processed by b) and c).
*
* We may return a larger region if computing the above region precisely is
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org