Closed Bug 252920 Opened 21 years ago Closed 20 years ago

The text shifts a bit downwards when focusing the link

Categories

(Core :: Layout: Tables, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: martijn.martijn, Assigned: roc)

References

(Blocks 1 open bug, )

Details

(Keywords: testcase)

Attachments

(6 files)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a3) Gecko/20040722 Firefox/0.9.1+ Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a3) Gecko/20040722 Firefox/0.9.1+ It happens with a lot of the links to the subfora at that url, but I'll attach a testcase here. The problem is that the text and the link shifts 1px downwards when focussing the link. It happens with a specific combination of tags and style. See testcase. It doesn't happen in: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a3) Gecko/20040716 But it happens in: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a3) Gecko/20040717 Maybe this is a regression of the fixing of bug 151375? Reproducible: Always Steps to Reproduce: 1. See testcase and focus link 2. 3. Actual Results: No shift of text and link Expected Results: Little shift of text and link
Attached file Testcase
Summary: The text shifts a bit downwards when focussing the link → The text shifts a bit downwards when focusing the link
Here, at this url focusing the link 'David Baron explains in a post to netscape.mozilla.public.seamonkey' causes the table to grow a bit to the right. http://www.mozillazine.org/talkback.html?article=3405
Blocks: 253385
Oh joy! Another regression from our outline work.
Assignee: nobody → aaronleventhal
Blocks: focusnav
Most likely a table incremental reflow bug.
Assignee: aaronleventhal → nobody
Component: Layout → Layout: Tables
QA Contact: core.layout → core.layout.tables
On this site appears a horizontal scrollbar when you focus the 'help', 'bookmark this page' or 'demo' links, at the most right of the page: http://www.ukpersonal.hsbc.co.uk/public/ukpersonal/internet_banking/en/logon.jhtml It disappears again when it is unfocused.
I plan to work on this in a week or two. If I forget, someone please ping me. And someone please make sure that we don't release 1.8a3 or 1.8beta with this!
Setting blocking request flag per comment 6
Flags: blocking1.8a3?
Blocks: 254746
Attached file testcase2
OK, I didn't get to it for 1.8a3 but here's a testcase that shows this is definitely a generic table incremental reflow bug. The table, the vertical-align:middle, the space after the <br>, and the empty span at the end of the line are all necessary to see this bug!
Actually I wonder if even the stable rendering of that testcase is at all correct.
I think the text should be at the top of the cell, with a blank line under it, not the middle. Anyone else have an opinion?
Attached file reflow log
I doubt that it is table reflow bug but rather a block reflow issue, especially I don't understand why the inner block produces all over sudden an overflow area. Don't we still have that br-1twips hack in block code ?
> Don't we still have that br-1twips hack in block code ? er, what hack is that?
btw: the default for the table cell is valign:middle and this is also the computed style shown in inspector
Ah yes, so the stable rendering is correct since the following line is suppressed and the lone line is centered in the cell.
Attached image frames before hover
Attached image after hover
Forgive me if this is a stupid question, but I thought that focusing itself causing a reflow is a bug. But that's not a bug? I've seen this shifting-when-focusing stuff happening at a few other places. Should I report them all? One of such a case I still can remember is the xul error page. The 'Try again' link shifts down when focused (probably indeed into the right position). I can attach a testcase, if you like.
the testcase has a td:hover { letter-spacing:0.001px; } and it should cause a style change reflow on the table cell on hover, which it does. see cell 0234FE38 r=1 incr. (Style) a=2808,UC c=2760,600 cnt=898 what fascinates me more is already the initial reflow: block 0234FE98 r=0 a=UC,UC c=UC,UC cnt=870 ... block 0234FE98 d=2760,240 me=636 o=(0,0) 2760 x 282 how a block during an unconstrained reflow can generate an overflow area is strange
Blocks: 255584
Minimal table-free testcases can be found at bug 255584
Keywords: testcase
OS: Windows XP → All
Bug 255584 turned out not to be related to this.
Attached patch fixSplinter Review
[Sorry for the small context in this diff, I had to separate it from my other nsBlockFrame patches...] There are two bugs here. The issue that Bernd noticed with the overflow area was a bug in ComputeCombinedArea, which unions rects by hand and doesn't properly ignore lines whose combined areas are empty. So I changed it to use nsRects and that problem is fixed. The other bug, which is the real bug here, is that when ReflowDirtyLines skips a not-dirty line, it updates aState.mY (the current vertical position) to the line's mBounds.YMost() even if the line is empty. In this case, had the line been dirty, PlaceLine() would *not* have advanced the mY. So we need to change the optimized path to match the normal path and only advance mY for non-empty lines. Note that normally setting mY in the ReflowDirtyLines loop doesn't have much effect because deltaY is used to control the placement of lines and mY is ignored or reset. But mY is eventually used to compute the block height (and according to the comments, also in float damage computation) so we'd better set it right.
Assignee: nobody → roc
Status: NEW → ASSIGNED
Comment on attachment 156314 [details] [diff] [review] fix These seem simple, but my understanding of margins is limited and hey, block reflow, you never know what could happen :-)
Attachment #156314 - Flags: superreview?(dbaron)
Attachment #156314 - Flags: review?(dbaron)
Isn't what PlaceLine does more complicated than this?
This is what PlaceLine does: else { // aLine->IsEmpty() // Don't let the previous-bottom-margin value affect the newY // coordinate (it was applied in ReflowInlineFrames speculatively) // since the line is empty. // We already called |ShouldApplyTopMargin|, and if we applied it // then BRS_APPLYTOPMARGIN is set. nscoord dy = aState.GetFlag(BRS_APPLYTOPMARGIN) ? -aState.mPrevBottomMargin.get() : 0; newY = aState.mY + dy; aLine->SlideBy(dy); // XXXldb Do we really want to do this? // keep our ascent in sync // XXXldb If it's empty, shouldn't the next line control the ascent? if (mLines.front() == aLine) { mAscent += dy; } } My understanding of this code is weak, I admit, but I think non-zero dy is just undoing something that was done speculatively in ReflowInlineFrames, and therefore there is no need to do it again when the line has not been reflowed. PlaceLine does do an extra thing before setting mY = newY; it checks if the line fits in the available height. But ReflowDirtyLines just doesn't try to handle that right now when it slides lines, and this is not the right occasion to correct that. (I actually have a fix for this as part of my columns work.)
Flags: blocking1.8a3? → blocking1.8a3-
Blocks: 256282
Comment on attachment 156314 [details] [diff] [review] fix OK, I reread nsBlockFrame::ReflowDirtyLines and I agree that the last change does make sense.
Attachment #156314 - Flags: superreview?(dbaron)
Attachment #156314 - Flags: superreview+
Attachment #156314 - Flags: review?(dbaron)
Attachment #156314 - Flags: review+
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
I added a reftest: http://hg.mozilla.org/mozilla-central/rev/dc4e22e87f6c Firefox-2004-07-22-09-trunk fails if ".outline" is changed to the older ".MozOutline".
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: