mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 10:44:56 +00:00
Bug 501847 part 3. Make nsInlineFrame::SelfIsEmpty return false as needed for inlines that are part of an {ib} split, to avoid weird blank lines in the middle of {ib} splits. r=dbaron
This commit is contained in:
parent
64ec41f84d
commit
6dff446f0b
@ -124,16 +124,39 @@ nsInlineFrame::IsSelfEmpty()
|
||||
// XXX Top and bottom removed, since they shouldn't affect things, but this
|
||||
// doesn't really match with nsLineLayout.cpp's setting of
|
||||
// ZeroEffectiveSpanBox, anymore, so what should this really be?
|
||||
if (border->GetActualBorderWidth(NS_SIDE_RIGHT) != 0 ||
|
||||
border->GetActualBorderWidth(NS_SIDE_LEFT) != 0 ||
|
||||
!IsPaddingZero(padding->mPadding.GetRightUnit(),
|
||||
padding->mPadding.GetRight()) ||
|
||||
!IsPaddingZero(padding->mPadding.GetLeftUnit(),
|
||||
padding->mPadding.GetLeft()) ||
|
||||
!IsMarginZero(margin->mMargin.GetRightUnit(),
|
||||
margin->mMargin.GetRight()) ||
|
||||
!IsMarginZero(margin->mMargin.GetLeftUnit(),
|
||||
margin->mMargin.GetLeft())) {
|
||||
PRBool haveRight =
|
||||
border->GetActualBorderWidth(NS_SIDE_RIGHT) != 0 ||
|
||||
!IsPaddingZero(padding->mPadding.GetRightUnit(),
|
||||
padding->mPadding.GetRight()) ||
|
||||
!IsMarginZero(margin->mMargin.GetRightUnit(),
|
||||
margin->mMargin.GetRight());
|
||||
PRBool haveLeft =
|
||||
border->GetActualBorderWidth(NS_SIDE_LEFT) != 0 ||
|
||||
!IsPaddingZero(padding->mPadding.GetLeftUnit(),
|
||||
padding->mPadding.GetLeft()) ||
|
||||
!IsMarginZero(margin->mMargin.GetLeftUnit(),
|
||||
margin->mMargin.GetLeft());
|
||||
if (haveLeft || haveRight) {
|
||||
if (GetStateBits() & NS_FRAME_IS_SPECIAL) {
|
||||
PRBool haveStart, haveEnd;
|
||||
if (NS_STYLE_DIRECTION_LTR == GetStyleVisibility()->mDirection) {
|
||||
haveStart = haveLeft;
|
||||
haveEnd = haveRight;
|
||||
} else {
|
||||
haveStart = haveRight;
|
||||
haveEnd = haveLeft;
|
||||
}
|
||||
// For special frames, ignore things we know we'll skip in GetSkipSides.
|
||||
// XXXbz should we be doing this for non-special frames too, in a more
|
||||
// general way?
|
||||
|
||||
// Get the first continuation eagerly, as a performance optimization, to
|
||||
// avoid having to get it twice..
|
||||
nsIFrame* firstCont = GetFirstContinuation();
|
||||
return
|
||||
(!haveStart || nsLayoutUtils::FrameIsNonFirstInIBSplit(firstCont)) &&
|
||||
(!haveEnd || nsLayoutUtils::FrameIsNonLastInIBSplit(firstCont));
|
||||
}
|
||||
return PR_FALSE;
|
||||
}
|
||||
return PR_TRUE;
|
||||
|
6
layout/reftests/ib-split/emptyspan-1-ref.html
Normal file
6
layout/reftests/ib-split/emptyspan-1-ref.html
Normal file
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<body style="direction: ltr">
|
||||
<span style="display: block">x</span>
|
||||
<span style="border: 5px solid blue; border-left: none; border-right: none;
|
||||
padding-right: 10px"></span>
|
||||
</body>
|
7
layout/reftests/ib-split/emptyspan-1.html
Normal file
7
layout/reftests/ib-split/emptyspan-1.html
Normal file
@ -0,0 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<body style="direction: ltr">
|
||||
<span style="border: 5px solid blue; border-left: none; border-right: none;
|
||||
padding-right: 10px">
|
||||
<span style="display: block">x</span>
|
||||
</span>
|
||||
</body>
|
6
layout/reftests/ib-split/emptyspan-2-ref.html
Normal file
6
layout/reftests/ib-split/emptyspan-2-ref.html
Normal file
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<body style="direction: rtl">
|
||||
<span style="border: 5px solid blue; border-left: none; border-right: none;
|
||||
padding-right: 10px"></span>
|
||||
<span style="display: block">x</span>
|
||||
</body>
|
7
layout/reftests/ib-split/emptyspan-2.html
Normal file
7
layout/reftests/ib-split/emptyspan-2.html
Normal file
@ -0,0 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<body style="direction: rtl">
|
||||
<span style="border: 5px solid blue; border-left: none; border-right: none;
|
||||
padding-right: 10px">
|
||||
<span style="display: block">x</span>
|
||||
</span>
|
||||
</body>
|
6
layout/reftests/ib-split/emptyspan-3-ref.html
Normal file
6
layout/reftests/ib-split/emptyspan-3-ref.html
Normal file
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<body style="direction: ltr">
|
||||
<span style="border: 5px solid blue; border-left: none; border-right: none;
|
||||
padding-left: 10px"></span>
|
||||
<span style="display: block">x</span>
|
||||
</body>
|
7
layout/reftests/ib-split/emptyspan-3.html
Normal file
7
layout/reftests/ib-split/emptyspan-3.html
Normal file
@ -0,0 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<body style="direction: ltr">
|
||||
<span style="border: 5px solid blue; border-left: none; border-right: none;
|
||||
padding-left: 10px">
|
||||
<span style="display: block">x</span>
|
||||
</span>
|
||||
</body>
|
6
layout/reftests/ib-split/emptyspan-4-ref.html
Normal file
6
layout/reftests/ib-split/emptyspan-4-ref.html
Normal file
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<body style="direction: rtl">
|
||||
<span style="display: block">x</span>
|
||||
<span style="border: 5px solid blue; border-left: none; border-right: none;
|
||||
padding-left: 10px"></span>
|
||||
</body>
|
7
layout/reftests/ib-split/emptyspan-4.html
Normal file
7
layout/reftests/ib-split/emptyspan-4.html
Normal file
@ -0,0 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<body style="direction: rtl">
|
||||
<span style="border: 5px solid blue; border-left: none; border-right: none;
|
||||
padding-left: 10px">
|
||||
<span style="display: block">x</span>
|
||||
</span>
|
||||
</body>
|
@ -44,4 +44,8 @@
|
||||
== insert-into-split-inline-16b.html insert-into-split-inline-16-ref.html
|
||||
== float-inside-inline-between-blocks-1.html float-inside-inline-between-blocks-1-ref.html
|
||||
== table-pseudo-in-part3-1.html table-pseudo-in-part3-1-ref.html
|
||||
== emptyspan-1.html emptyspan-1-ref.html
|
||||
== emptyspan-2.html emptyspan-2-ref.html
|
||||
== emptyspan-3.html emptyspan-3-ref.html
|
||||
== emptyspan-4.html emptyspan-4-ref.html
|
||||
== split-inner-inline-1.html split-inner-inline-1-ref.html
|
||||
|
Loading…
Reference in New Issue
Block a user