Backout 1ebc3b1b8feb, 205c1c846d70 (bug 801488), and e4367fd2043f (bug 804323) due to b-c crashes.

This commit is contained in:
Ryan VanderMeulen 2012-10-25 07:53:36 -04:00
parent c6c6a29327
commit f531358b85
8 changed files with 23 additions and 73 deletions

View File

@ -8149,23 +8149,13 @@ nsCSSFrameConstructor::ProcessRestyledFrames(nsStyleChangeList& aChangeList)
if (NeedToReframeForAddingOrRemovingTransform(frame)) {
NS_UpdateHint(hint, nsChangeHint_ReconstructFrame);
} else {
// Normally frame construction would set state bits as needed,
// but we're not going to reconstruct the frame so we need to set them.
// It's because we need to set this state on each affected frame
// We can just add this state bit unconditionally, since it's
// conservative. Normally frame construction would set this if needed,
// but we're not going to reconstruct the frame so we need to set it.
// It's because we need to set this bit on each affected frame
// that we can't coalesce nsChangeHint_AddOrRemoveTransform hints up
// to ancestors (i.e. it can't be an inherited change hint).
if (frame->IsPositioned()) {
// If a transform has been added, we'll be taking this path,
// but we may be taking this path even if a transform has been
// removed. It's OK to add the bit even if it's not needed.
frame->AddStateBits(NS_FRAME_MAY_BE_TRANSFORMED);
frame->MarkAsAbsoluteContainingBlock();
} else {
// Don't remove NS_FRAME_MAY_BE_TRANSFORMED since it may still by
// transformed by other means. It's OK to have the bit even if it's
// not needed.
frame->MarkAsNotAbsoluteContainingBlock();
}
frame->AddStateBits(NS_FRAME_MAY_BE_TRANSFORMED);
}
}
if (hint & nsChangeHint_ReconstructFrame) {

View File

@ -249,20 +249,11 @@ nsIFrame::GetAbsoluteContainingBlock() const {
}
void
nsIFrame::MarkAsAbsoluteContainingBlock()
{
nsIFrame::MarkAsAbsoluteContainingBlock() {
AddStateBits(NS_FRAME_HAS_ABSPOS_CHILDREN);
Properties().Set(AbsoluteContainingBlockProperty(), new nsAbsoluteContainingBlock(GetAbsoluteListID()));
}
void
nsIFrame::MarkAsNotAbsoluteContainingBlock()
{
NS_ASSERTION(!HasAbsolutelyPositionedChildren(), "Think of the children!");
RemoveStateBits(NS_FRAME_HAS_ABSPOS_CHILDREN);
Properties().Delete(AbsoluteContainingBlockProperty());
}
void
nsIFrame::ClearDisplayItemCache()
{

View File

@ -2870,8 +2870,7 @@ NS_PTR_TO_INT32(frame->Properties().Get(nsIFrame::ParagraphDepthProperty()))
bool IsAbsoluteContainer() const { return !!(mState & NS_FRAME_HAS_ABSPOS_CHILDREN); }
bool HasAbsolutelyPositionedChildren() const;
nsAbsoluteContainingBlock* GetAbsoluteContainingBlock() const;
void MarkAsAbsoluteContainingBlock();
void MarkAsNotAbsoluteContainingBlock();
virtual void MarkAsAbsoluteContainingBlock();
// Child frame types override this function to select their own child list name
virtual mozilla::layout::FrameChildListID GetAbsoluteListID() const { return kAbsoluteList; }

View File

@ -1,19 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<style>
body { margin:0; padding:0; overflow:hidden; }
#new {
position: absolute;
left: 200px;
top: 100px;
width: 100px;
height: 100px;
background: yellow;
}
</style>
</head>
<body>
<div id="new"></div>
</body>
</html>

View File

@ -1,25 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<style>
body { margin:0; padding:0; overflow:hidden; }
#new {
position: absolute;
left: 100px;
top: 100px;
width: 100px;
height: 100px;
background: yellow;
}
</style>
</head>
<body>
<div id="new" style="display:none"></div>
<script>
document.body.getBoundingClientRect().height;
document.body.style.transform = "translateX(100px)";
document.body.getBoundingClientRect().width;
document.getElementById("new").style.display = "";
</script>
</body>
</html>

View File

@ -1726,4 +1726,3 @@ fuzzy-if(true,17,5859) == 759036-2.html 759036-2-ref.html
fuzzy(40,800) == 797797-1.html 797797-1-ref.html # 'opacity:N' and rgba(,,,N) text don't match precisely
fuzzy(40,800) == 797797-2.html 797797-2-ref.html # 'opacity:N' and rgba(,,,N) text don't match precisely
== 801994-1.html 801994-1-ref.html
== 804323-1.html 804323-1-ref.html

View File

@ -901,6 +901,10 @@ nsSplitterFrameInner::AdjustChildren(nsPresContext* aPresContext)
AdjustChildren(aPresContext, mChildInfosBefore, mChildInfosBeforeCount, isHorizontal);
AdjustChildren(aPresContext, mChildInfosAfter, mChildInfosAfterCount, isHorizontal);
// printf("----- Posting Dirty -----\n");
aPresContext->PresShell()->FlushPendingNotifications(Flush_Display);
}
static nsIFrame* GetChildBoxForContent(nsIFrame* aParentBox, nsIContent* aContent)

View File

@ -340,7 +340,8 @@ nsStackLayout::Layout(nsIFrame* aBox, nsBoxLayoutState& aState)
child->Layout(aState);
// Get the child's new rect.
childRect = child->GetRect();
nsRect childRectNoMargin;
childRectNoMargin = childRect = child->GetRect();
childRect.Inflate(margin);
if (child->GetStyleXUL()->mStretchStack) {
@ -355,6 +356,16 @@ nsStackLayout::Layout(nsIFrame* aBox, nsBoxLayoutState& aState)
grow = true;
}
}
if (!childRectNoMargin.IsEqualInterior(oldRect))
{
// redraw the new and old positions if the
// child moved or resized.
// if the new and old rect intersect meaning we just moved a little
// then just redraw the union. If they don't intersect (meaning
// we moved a good distance) redraw both separately.
aBox->Redraw(aState);
}
}
child = child->GetNextBox();