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)
Tracking
()
RESOLVED
FIXED
People
(Reporter: martijn.martijn, Assigned: roc)
References
(Blocks 1 open bug, )
Details
(Keywords: testcase)
Attachments
(6 files)
319 bytes,
text/html
|
Details | |
286 bytes,
text/html
|
Details | |
8.89 KB,
text/plain
|
Details | |
1.79 KB,
image/png
|
Details | |
1.64 KB,
image/png
|
Details | |
3.08 KB,
patch
|
dbaron
:
review+
dbaron
:
superreview+
|
Details | Diff | Splinter Review |
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
Reporter | ||
Comment 1•21 years ago
|
||
Updated•21 years ago
|
Summary: The text shifts a bit downwards when focussing the link → The text shifts a bit downwards when focusing the link
Reporter | ||
Comment 2•21 years ago
|
||
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
Comment 3•21 years ago
|
||
Oh joy! Another regression from our outline work.
Assignee: nobody → aaronleventhal
Blocks: focusnav
Assignee | ||
Comment 4•21 years ago
|
||
Most likely a table incremental reflow bug.
Updated•21 years ago
|
Assignee: aaronleventhal → nobody
Component: Layout → Layout: Tables
QA Contact: core.layout → core.layout.tables
Reporter | ||
Comment 5•21 years ago
|
||
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.
Assignee | ||
Comment 6•20 years ago
|
||
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!
Assignee | ||
Comment 8•20 years ago
|
||
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!
Assignee | ||
Comment 9•20 years ago
|
||
Actually I wonder if even the stable rendering of that testcase is at all correct.
Assignee | ||
Comment 10•20 years ago
|
||
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?
Comment 11•20 years ago
|
||
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 ?
Assignee | ||
Comment 12•20 years ago
|
||
> Don't we still have that br-1twips hack in block code ?
er, what hack is that?
Comment 13•20 years ago
|
||
btw: the default for the table cell is valign:middle and this is also the
computed style shown in inspector
Assignee | ||
Comment 14•20 years ago
|
||
Ah yes, so the stable rendering is correct since the following line is
suppressed and the lone line is centered in the cell.
Comment 15•20 years ago
|
||
1- twips hack is that code still used ?
http://lxr.mozilla.org/seamonkey/source/layout/html/base/src/nsBRFrame.cpp#189
Comment 16•20 years ago
|
||
Comment 17•20 years ago
|
||
Reporter | ||
Comment 18•20 years ago
|
||
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.
Comment 19•20 years ago
|
||
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
Comment 20•20 years ago
|
||
Minimal table-free testcases can be found at bug 255584
Keywords: testcase
OS: Windows XP → All
Assignee | ||
Comment 21•20 years ago
|
||
Bug 255584 turned out not to be related to this.
Assignee | ||
Comment 22•20 years ago
|
||
[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 | ||
Updated•20 years ago
|
Assignee: nobody → roc
Status: NEW → ASSIGNED
Assignee | ||
Comment 23•20 years ago
|
||
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?
Assignee | ||
Comment 25•20 years ago
|
||
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.)
Updated•20 years ago
|
Flags: blocking1.8a3? → blocking1.8a3-
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+
Assignee | ||
Comment 27•20 years ago
|
||
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Comment 28•16 years ago
|
||
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.
Description
•