зеркало из https://github.com/mozilla/pjs.git
Bug 71594. Reparent views from 'trailing' frame, but only make trailing frame if it'd have children. r=karnaze, sr=attinasi
This commit is contained in:
Родитель
45fdc6ba7e
Коммит
cdce771b29
|
@ -12544,36 +12544,44 @@ nsCSSFrameConstructor::ConstructInline(nsIPresShell* aPresShell,
|
||||||
// list3's frames belong to another inline frame
|
// list3's frames belong to another inline frame
|
||||||
nsIFrame* inlineFrame = nsnull;
|
nsIFrame* inlineFrame = nsnull;
|
||||||
|
|
||||||
if (aIsPositioned) {
|
|
||||||
NS_NewPositionedInlineFrame(aPresShell, &inlineFrame);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
NS_NewInlineFrame(aPresShell, &inlineFrame);
|
|
||||||
}
|
|
||||||
|
|
||||||
InitAndRestoreFrame(aPresContext, aState, aContent,
|
|
||||||
aParentFrame, aStyleContext, nsnull, inlineFrame);
|
|
||||||
|
|
||||||
if (aIsPositioned) {
|
|
||||||
// Relatively positioned frames need a view
|
|
||||||
nsHTMLContainerFrame::CreateViewForFrame(aPresContext, inlineFrame,
|
|
||||||
aStyleContext, nsnull, PR_FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (list3) {
|
if (list3) {
|
||||||
|
if (aIsPositioned) {
|
||||||
|
NS_NewPositionedInlineFrame(aPresShell, &inlineFrame);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
NS_NewInlineFrame(aPresShell, &inlineFrame);
|
||||||
|
}
|
||||||
|
|
||||||
|
InitAndRestoreFrame(aPresContext, aState, aContent,
|
||||||
|
aParentFrame, aStyleContext, nsnull, inlineFrame);
|
||||||
|
|
||||||
|
if (aIsPositioned) {
|
||||||
|
// Relatively positioned frames need a view
|
||||||
|
nsHTMLContainerFrame::CreateViewForFrame(aPresContext, inlineFrame,
|
||||||
|
aStyleContext, nsnull, PR_FALSE);
|
||||||
|
|
||||||
|
// Move list3's frames into the new view
|
||||||
|
nsIFrame* oldParent;
|
||||||
|
list3->GetParent(&oldParent);
|
||||||
|
nsHTMLContainerFrame::ReparentFrameViewList(aPresContext, list3, oldParent, inlineFrame);
|
||||||
|
}
|
||||||
|
|
||||||
// Reparent (cheaply) the frames in list3 - we don't have to futz
|
// Reparent (cheaply) the frames in list3 - we don't have to futz
|
||||||
// with their style context because they already have the right one.
|
// with their style context because they already have the right one.
|
||||||
nsFrameList list;
|
nsFrameList list;
|
||||||
list.AppendFrames(inlineFrame, list3);
|
list.AppendFrames(inlineFrame, list3);
|
||||||
|
|
||||||
|
inlineFrame->SetInitialChildList(aPresContext, nsnull, list3);
|
||||||
}
|
}
|
||||||
inlineFrame->SetInitialChildList(aPresContext, nsnull, list3);
|
|
||||||
|
|
||||||
// Mark the 3 frames as special. That way if any of the
|
// Mark the 3 frames as special. That way if any of the
|
||||||
// append/insert/remove methods try to fiddle with the children, the
|
// append/insert/remove methods try to fiddle with the children, the
|
||||||
// containing block will be reframed instead.
|
// containing block will be reframed instead.
|
||||||
SetFrameIsSpecial(aState.mFrameManager, aNewFrame, blockFrame);
|
SetFrameIsSpecial(aState.mFrameManager, aNewFrame, blockFrame);
|
||||||
SetFrameIsSpecial(aState.mFrameManager, blockFrame, inlineFrame);
|
SetFrameIsSpecial(aState.mFrameManager, blockFrame, inlineFrame);
|
||||||
SetFrameIsSpecial(aState.mFrameManager, inlineFrame, nsnull);
|
|
||||||
|
if (inlineFrame)
|
||||||
|
SetFrameIsSpecial(aState.mFrameManager, inlineFrame, nsnull);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (gNoisyInlineConstruction) {
|
if (gNoisyInlineConstruction) {
|
||||||
|
@ -12588,7 +12596,7 @@ nsCSSFrameConstructor::ConstructInline(nsIPresShell* aPresShell,
|
||||||
printf(" ==> block frame:\n");
|
printf(" ==> block frame:\n");
|
||||||
frameDebug->List(aPresContext, stdout, 2);
|
frameDebug->List(aPresContext, stdout, 2);
|
||||||
}
|
}
|
||||||
if (NS_SUCCEEDED(inlineFrame->QueryInterface(NS_GET_IID(nsIFrameDebug), (void**)&frameDebug))) {
|
if (inlineFrame && NS_SUCCEEDED(inlineFrame->QueryInterface(NS_GET_IID(nsIFrameDebug), (void**)&frameDebug))) {
|
||||||
printf(" ==> trailing inline frame:\n");
|
printf(" ==> trailing inline frame:\n");
|
||||||
frameDebug->List(aPresContext, stdout, 2);
|
frameDebug->List(aPresContext, stdout, 2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12544,36 +12544,44 @@ nsCSSFrameConstructor::ConstructInline(nsIPresShell* aPresShell,
|
||||||
// list3's frames belong to another inline frame
|
// list3's frames belong to another inline frame
|
||||||
nsIFrame* inlineFrame = nsnull;
|
nsIFrame* inlineFrame = nsnull;
|
||||||
|
|
||||||
if (aIsPositioned) {
|
|
||||||
NS_NewPositionedInlineFrame(aPresShell, &inlineFrame);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
NS_NewInlineFrame(aPresShell, &inlineFrame);
|
|
||||||
}
|
|
||||||
|
|
||||||
InitAndRestoreFrame(aPresContext, aState, aContent,
|
|
||||||
aParentFrame, aStyleContext, nsnull, inlineFrame);
|
|
||||||
|
|
||||||
if (aIsPositioned) {
|
|
||||||
// Relatively positioned frames need a view
|
|
||||||
nsHTMLContainerFrame::CreateViewForFrame(aPresContext, inlineFrame,
|
|
||||||
aStyleContext, nsnull, PR_FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (list3) {
|
if (list3) {
|
||||||
|
if (aIsPositioned) {
|
||||||
|
NS_NewPositionedInlineFrame(aPresShell, &inlineFrame);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
NS_NewInlineFrame(aPresShell, &inlineFrame);
|
||||||
|
}
|
||||||
|
|
||||||
|
InitAndRestoreFrame(aPresContext, aState, aContent,
|
||||||
|
aParentFrame, aStyleContext, nsnull, inlineFrame);
|
||||||
|
|
||||||
|
if (aIsPositioned) {
|
||||||
|
// Relatively positioned frames need a view
|
||||||
|
nsHTMLContainerFrame::CreateViewForFrame(aPresContext, inlineFrame,
|
||||||
|
aStyleContext, nsnull, PR_FALSE);
|
||||||
|
|
||||||
|
// Move list3's frames into the new view
|
||||||
|
nsIFrame* oldParent;
|
||||||
|
list3->GetParent(&oldParent);
|
||||||
|
nsHTMLContainerFrame::ReparentFrameViewList(aPresContext, list3, oldParent, inlineFrame);
|
||||||
|
}
|
||||||
|
|
||||||
// Reparent (cheaply) the frames in list3 - we don't have to futz
|
// Reparent (cheaply) the frames in list3 - we don't have to futz
|
||||||
// with their style context because they already have the right one.
|
// with their style context because they already have the right one.
|
||||||
nsFrameList list;
|
nsFrameList list;
|
||||||
list.AppendFrames(inlineFrame, list3);
|
list.AppendFrames(inlineFrame, list3);
|
||||||
|
|
||||||
|
inlineFrame->SetInitialChildList(aPresContext, nsnull, list3);
|
||||||
}
|
}
|
||||||
inlineFrame->SetInitialChildList(aPresContext, nsnull, list3);
|
|
||||||
|
|
||||||
// Mark the 3 frames as special. That way if any of the
|
// Mark the 3 frames as special. That way if any of the
|
||||||
// append/insert/remove methods try to fiddle with the children, the
|
// append/insert/remove methods try to fiddle with the children, the
|
||||||
// containing block will be reframed instead.
|
// containing block will be reframed instead.
|
||||||
SetFrameIsSpecial(aState.mFrameManager, aNewFrame, blockFrame);
|
SetFrameIsSpecial(aState.mFrameManager, aNewFrame, blockFrame);
|
||||||
SetFrameIsSpecial(aState.mFrameManager, blockFrame, inlineFrame);
|
SetFrameIsSpecial(aState.mFrameManager, blockFrame, inlineFrame);
|
||||||
SetFrameIsSpecial(aState.mFrameManager, inlineFrame, nsnull);
|
|
||||||
|
if (inlineFrame)
|
||||||
|
SetFrameIsSpecial(aState.mFrameManager, inlineFrame, nsnull);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (gNoisyInlineConstruction) {
|
if (gNoisyInlineConstruction) {
|
||||||
|
@ -12588,7 +12596,7 @@ nsCSSFrameConstructor::ConstructInline(nsIPresShell* aPresShell,
|
||||||
printf(" ==> block frame:\n");
|
printf(" ==> block frame:\n");
|
||||||
frameDebug->List(aPresContext, stdout, 2);
|
frameDebug->List(aPresContext, stdout, 2);
|
||||||
}
|
}
|
||||||
if (NS_SUCCEEDED(inlineFrame->QueryInterface(NS_GET_IID(nsIFrameDebug), (void**)&frameDebug))) {
|
if (inlineFrame && NS_SUCCEEDED(inlineFrame->QueryInterface(NS_GET_IID(nsIFrameDebug), (void**)&frameDebug))) {
|
||||||
printf(" ==> trailing inline frame:\n");
|
printf(" ==> trailing inline frame:\n");
|
||||||
frameDebug->List(aPresContext, stdout, 2);
|
frameDebug->List(aPresContext, stdout, 2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
<!doctype html public "-//w3c//dtd html 4.0 Transitional//en" "http://www.w3.org/TR/REC-html40/strict.dtd"><html><body><span style="position:relative;left:20px;top:30px;"><hr /><span style="position:relative;left:70px;top:25px;">test</span></span></body></html>
|
Загрузка…
Ссылка в новой задаче