Bug 989130 - Back out changeset fe119a83b1f2 (bug 942017) while leaving the corresponding test from changeset 3c63decb4e7e. r=jfkthame

This should be backed out for two reasons:

 (1) It caused a serious regression with bullets from list-style-image,
     which no longer affect the line box height and thus overlap.

 (2) The dependency on 'line-height: normal' doesn't make sense; there's
     no reason for whether line-height is 'normal' or not to affect the
     behavior of bullets.

I don't currently have time to figure out why Gecko behavior differs
from other browsers on bug 942017, but that should be re-analyzed and
the bug fixed in a different way.  At first glance, the code should
already be leading to the expected behavior, since the bullet ought to
have the same metrics and alignment as the block's influence on the line
box's height.  Why this isn't the case should be investigated.
This commit is contained in:
L. David Baron 2014-04-01 11:53:29 -07:00
parent bda8515798
commit 0f609689eb
2 changed files with 9 additions and 7 deletions

View File

@ -2000,8 +2000,8 @@ nsLineLayout::BlockDirAlignFrames(PerSpanData* psd)
// Update minBCoord/maxBCoord for frames that we just placed. Do not factor
// text into the equation.
if (pfd->mBlockDirAlign == VALIGN_OTHER) {
// Text frames and bullets do not contribute to the min/max Y values for
// the line (instead their parent frame's font-size contributes).
// Text frames do not contribute to the min/max Y values for the
// line (instead their parent frame's font-size contributes).
// XXXrbs -- relax this restriction because it causes text frames
// to jam together when 'font-size-adjust' is enabled
// and layout is using dynamic font heights (bug 20394)
@ -2012,15 +2012,17 @@ nsLineLayout::BlockDirAlignFrames(PerSpanData* psd)
// For example in quirks mode, avoiding empty text frames prevents
// "tall" lines around elements like <hr> since the rules of <hr>
// in quirks.css have pseudo text contents with LF in them.
#if 0
if (!pfd->GetFlag(PFD_ISTEXTFRAME)) {
#else
// Only consider non empty text frames when line-height=normal
bool canUpdate = !pfd->GetFlag(PFD_ISTEXTFRAME);
if ((!canUpdate && pfd->GetFlag(PFD_ISNONWHITESPACETEXTFRAME)) ||
(canUpdate && (pfd->GetFlag(PFD_ISBULLET) ||
nsGkAtoms::bulletFrame == frame->GetType()))) {
// Only consider bullet / non-empty text frames when line-height:normal.
if (!canUpdate && pfd->GetFlag(PFD_ISNONWHITESPACETEXTFRAME)) {
canUpdate =
frame->StyleText()->mLineHeight.GetUnit() == eStyleUnit_Normal;
}
if (canUpdate) {
#endif
nscoord blockStart, blockEnd;
if (frameSpan) {
// For spans that were are now placing, use their position

View File

@ -1788,7 +1788,7 @@ fuzzy-if(cocoaWidget,1,40) == 928607-1.html 928607-1-ref.html
fuzzy-if(OSX==10.6,2,30) skip-if(B2G&&browserIsRemote) == 933264-1.html 933264-1-ref.html
== 936670-1.svg 936670-1-ref.svg
== 941940-1.html 941940-1-ref.html
== 942017.html 942017-ref.html
fails == 942017.html 942017-ref.html # bug 942017
== 942672-1.html 942672-1-ref.html
== 953334-win32-clipping.html 953334-win32-clipping-ref.html
== 956513-1.svg 956513-1-ref.svg