Make lines with only a bullet take up height. (Bug 179596 / Bug 507187) r=roc
This commit is contained in:
@@ -286,6 +286,9 @@ nsLineBox::IsEmpty() const
|
||||
if (!kid->IsEmpty())
|
||||
return PR_FALSE;
|
||||
}
|
||||
if (HasBullet()) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
@@ -316,6 +319,9 @@ nsLineBox::CachedIsEmpty()
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (HasBullet()) {
|
||||
result = PR_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
mFlags.mEmptyCacheValid = PR_TRUE;
|
||||
|
||||
@@ -318,6 +318,20 @@ public:
|
||||
return mFlags.mResizeReflowOptimizationDisabled;
|
||||
}
|
||||
|
||||
// mHasBullet bit
|
||||
void SetHasBullet() {
|
||||
mFlags.mHasBullet = PR_TRUE;
|
||||
InvalidateCachedIsEmpty();
|
||||
}
|
||||
void ClearHasBullet() {
|
||||
mFlags.mHasBullet = PR_FALSE;
|
||||
InvalidateCachedIsEmpty();
|
||||
}
|
||||
PRBool HasBullet() const {
|
||||
return mFlags.mHasBullet;
|
||||
}
|
||||
|
||||
|
||||
// mChildCount value
|
||||
PRInt32 GetChildCount() const {
|
||||
return (PRInt32) mFlags.mChildCount;
|
||||
@@ -484,9 +498,12 @@ public:
|
||||
PRUint32 mResizeReflowOptimizationDisabled: 1; // default 0 = means that the opt potentially applies to this line. 1 = never skip reflowing this line for a resize reflow
|
||||
PRUint32 mEmptyCacheValid: 1;
|
||||
PRUint32 mEmptyCacheState: 1;
|
||||
// mHasBullet indicates that this is an inline line whose block's
|
||||
// bullet is adjacent to this line.
|
||||
PRUint32 mHasBullet : 1;
|
||||
PRUint32 mBreakType : 4;
|
||||
|
||||
PRUint32 mChildCount : 18;
|
||||
PRUint32 mChildCount : 17;
|
||||
};
|
||||
|
||||
struct ExtraData {
|
||||
|
||||
@@ -207,6 +207,10 @@ nsLineLayout::BeginLineReflow(nscoord aX, nscoord aY,
|
||||
mSpanDepth = 0;
|
||||
mMaxTopBoxHeight = mMaxBottomBoxHeight = 0;
|
||||
|
||||
if (GetFlag(LL_GOTLINEBOX)) {
|
||||
mLineBox->ClearHasBullet();
|
||||
}
|
||||
|
||||
PerSpanData* psd;
|
||||
NewPerSpanData(&psd);
|
||||
mCurrentSpan = mRootSpan = psd;
|
||||
@@ -1327,8 +1331,10 @@ nsLineLayout::AddBulletFrame(nsIFrame* aFrame,
|
||||
const nsHTMLReflowMetrics& aMetrics)
|
||||
{
|
||||
NS_ASSERTION(mCurrentSpan == mRootSpan, "bad linelayout user");
|
||||
NS_ASSERTION(GetFlag(LL_GOTLINEBOX), "must have line box");
|
||||
|
||||
SetFlag(LL_HASBULLET, PR_TRUE);
|
||||
mLineBox->SetHasBullet();
|
||||
|
||||
PerFrameData* pfd;
|
||||
nsresult rv = NewPerFrameData(&pfd);
|
||||
|
||||
2
layout/reftests/bugs/507187-1-ref.html
Normal file
2
layout/reftests/bugs/507187-1-ref.html
Normal file
@@ -0,0 +1,2 @@
|
||||
<style type="text/css">a { visibility: hidden }</style>
|
||||
<body><ul><li><a>Hello</a></li><li><a>Hello</a></li><li><a>Hello</a></li><li><a>Hello</a></li></ul></body></html>
|
||||
1
layout/reftests/bugs/507187-1.html
Normal file
1
layout/reftests/bugs/507187-1.html
Normal file
@@ -0,0 +1 @@
|
||||
<body><ul><li><a></a></li><li><a></a></li><li><a></a></li><li><a></a></li></ul></body></html>
|
||||
@@ -1298,6 +1298,7 @@ fails-if(MOZ_WIDGET_TOOLKIT!="cocoa") == 488692-1.html 488692-1-ref.html # needs
|
||||
== 503364-1b.html 503364-1-ref.html
|
||||
== 504032-1.html 504032-1-ref.html
|
||||
== 505743-1.html about:blank
|
||||
== 507187-1.html 507187-1-ref.html
|
||||
== 507487-1.html 507487-1-ref.html
|
||||
== 507487-2.xhtml 507487-2-ref.xhtml
|
||||
== 508919-1.xhtml 508919-1-ref.xhtml
|
||||
|
||||
Reference in New Issue
Block a user