Backed out changeset dc2ced1dd175 (bug 860524) for reftest failures

This commit is contained in:
Ed Morley 2013-04-19 13:51:24 +01:00
parent a7a41f0415
commit c05f10b133
7 changed files with 29 additions and 72 deletions

View File

@ -53,7 +53,15 @@ public:
};
// Constructs a DisplayItemClip that does no clipping at all.
DisplayItemClip() : mHaveClipRect(false) {}
DisplayItemClip() : mHaveClipRect(false), mHasBeenDestroyed(false) {}
~DisplayItemClip() { mHasBeenDestroyed = true; }
void MaybeDestroy() const
{
if (!mHasBeenDestroyed) {
this->~DisplayItemClip();
}
}
void SetTo(const nsRect& aRect);
void SetTo(const nsRect& aRect, const nscoord* aRadii);
@ -168,6 +176,9 @@ private:
// If mHaveClipRect is false then this object represents no clipping at all
// and mRoundedClipRects must be empty.
bool mHaveClipRect;
// Set to true when the destructor has run. This is a bit of a hack
// to ensure that we can easily share arena-allocated DisplayItemClips.
bool mHasBeenDestroyed;
};
}

View File

@ -18,16 +18,17 @@ DisplayListClipState::GetCurrentCombinedClip(nsDisplayListBuilder* aBuilder)
if (!mClipContentDescendants && !mClipContainingBlockDescendants) {
return nullptr;
}
void* mem = aBuilder->Allocate(sizeof(DisplayItemClip));
if (mClipContentDescendants) {
DisplayItemClip* newClip =
aBuilder->AllocateDisplayItemClip(*mClipContentDescendants);
new (mem) DisplayItemClip(*mClipContentDescendants);
if (mClipContainingBlockDescendants) {
newClip->IntersectWith(*mClipContainingBlockDescendants);
}
mCurrentCombinedClip = newClip;
} else {
mCurrentCombinedClip =
aBuilder->AllocateDisplayItemClip(*mClipContainingBlockDescendants);
new (mem) DisplayItemClip(*mClipContainingBlockDescendants);
}
return mCurrentCombinedClip;
}

View File

@ -707,10 +707,6 @@ nsDisplayListBuilder::~nsDisplayListBuilder() {
nsCSSRendering::EndFrameTreesLocked();
for (uint32_t i = 0; i < mDisplayItemClipsToDestroy.Length(); ++i) {
mDisplayItemClipsToDestroy[i]->DisplayItemClip::~DisplayItemClip();
}
PL_FinishArenaPool(&mPool);
MOZ_COUNT_DTOR(nsDisplayListBuilder);
}
@ -872,15 +868,6 @@ nsDisplayListBuilder::Allocate(size_t aSize) {
return tmp;
}
DisplayItemClip*
nsDisplayListBuilder::AllocateDisplayItemClip(const DisplayItemClip& aOriginal)
{
void* p = Allocate(sizeof(DisplayItemClip));
DisplayItemClip* c = new (p) DisplayItemClip(aOriginal);
mDisplayItemClipsToDestroy.AppendElement(c);
return c;
}
void nsDisplayListSet::MoveTo(const nsDisplayListSet& aDestination) const
{
aDestination.BorderBackground()->AppendToTop(BorderBackground());

View File

@ -478,13 +478,7 @@ public:
* destructors are called as soon as the item is no longer used.
*/
void* Allocate(size_t aSize);
/**
* Allocate a new DisplayListClip in the arena. Will be cleaned up
* automatically when the arena goes away.
*/
DisplayItemClip* AllocateDisplayItemClip(const DisplayItemClip& aOriginal);
/**
* A helper class to temporarily set the value of
* mIsAtRootOfPseudoStackingContext and mIsInFixedPosition, and temporarily
@ -652,7 +646,6 @@ private:
nsRegion mExcludedGlassRegion;
// The display item for the Windows window glass background, if any
nsDisplayItem* mGlassDisplayItem;
nsTArray<DisplayItemClip*> mDisplayItemClipsToDestroy;
Mode mMode;
bool mBuildCaret;
bool mIgnoreSuppression;
@ -753,7 +746,12 @@ public:
#endif
{
}
virtual ~nsDisplayItem() {}
virtual ~nsDisplayItem()
{
if (mClip) {
mClip->MaybeDestroy();
}
}
void* operator new(size_t aSize,
nsDisplayListBuilder* aBuilder) CPP_THROW_NEW {
@ -1195,11 +1193,17 @@ public:
}
void SetClip(nsDisplayListBuilder* aBuilder, const DisplayItemClip& aClip)
{
if (mClip) {
mClip->MaybeDestroy();
}
if (!aClip.HasClip()) {
mClip = nullptr;
return;
}
mClip = aBuilder->AllocateDisplayItemClip(aClip);
void* mem = aBuilder->Allocate(sizeof(DisplayItemClip));
DisplayItemClip* clip = new (mem) DisplayItemClip();
*clip = aClip;
mClip = clip;
}
protected:

View File

@ -76,8 +76,6 @@ skip-if(B2G) random-if(winWidget) HTTP(..) == corner-joins-2.xhtml corner-joins-
skip-if(B2G) fuzzy-if(/^Windows\x20NT\x206\.2/.test(http.oscpu),1,20) fuzzy-if(Android&&browserIsRemote,7,146) fuzzy-if(Android&&!browserIsRemote,166,248) == scroll-1.html scroll-1-ref.html # see bug 732535
== transforms-1.html transforms-1-ref.html
== zero-radius-clip-1.html zero-radius-clip-ref.html
== iframe-1.html iframe-1-ref.html

View File

@ -1,17 +0,0 @@
<!DOCTYPE html>
<html>
<body style="background:white">
<style>
div {
position: absolute;
width: 100px;
height: 100px;
border: solid 2px black;
background: black;
border-radius: 30px;
overflow: hidden;
}
</style>
<div>></div>
</body>
</html>

View File

@ -1,27 +0,0 @@
<!DOCTYPE html>
<html>
<body style="background:white">
<style>
div {
position: absolute;
width: 100px;
height: 100px;
border: solid 2px black;
background: black;
border-radius: 30px;
overflow: hidden;
}
span {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: black;
transform: scale(2);
}
</style>
<div><span></span></div>
</body>
</html>