Closed
Bug 263374
Opened 21 years ago
Closed 21 years ago
Horizontal lines on page (using text-indent and display: block)
Categories
(Core :: Layout: Block and Inline, defect, P3)
Core
Layout: Block and Inline
Tracking
()
VERIFIED
FIXED
mozilla1.8alpha6
People
(Reporter: Gavin, Assigned: bzbarsky)
References
()
Details
Attachments
(4 files, 4 obsolete files)
166.31 KB,
image/jpeg
|
Details | |
17.82 KB,
patch
|
Details | Diff | Splinter Review | |
17.05 KB,
patch
|
dbaron
:
review+
dbaron
:
superreview+
|
Details | Diff | Splinter Review |
853 bytes,
text/html
|
Details |
While viewing the URL given above, I see three horizontal blue lines across the
screen. Seems to be caused by a combination of text-indent: -9999px and display:
block on the li element. I believe the lines correspond to links that have
text-indent set to -9999px.
Will attach reduced testcase and screenshot.
Reproducible on:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a5) Gecko/20041007
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.4) Gecko/20041007
Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20040930 Firefox/0.10.1
(MOOX M3)
Reporter | ||
Comment 1•21 years ago
|
||
Reporter | ||
Comment 2•21 years ago
|
||
Reporter | ||
Comment 3•21 years ago
|
||
Note also that when selecting the link (via tab), the dotted border indicating
focus spans the width of the page.
![]() |
Assignee | |
Comment 4•21 years ago
|
||
Gavin, is the fact that <li> is involved needed to produce the bug?
If you set a smaller text-indent (say -200px), does this still happen?
Reporter | ||
Comment 5•21 years ago
|
||
No, it does not appear to be dependent on <LI>, and increasing the indent to
-100 has no effect either. See testcase 2.
Reporter | ||
Comment 6•21 years ago
|
||
Another testcase. Seems to be cause by having a link (<A>) inside a container
that has text-indent set to a large enough negative number to make it appear
off screen. It has something to do with the underlining of the links, as you
can see from this new testcase. Notice also that the border that indicates
focus on the link when you click on it spans the width of the browser window.
Might be related.
![]() |
Assignee | |
Comment 7•21 years ago
|
||
This testcase demonstrates several aspects of this bug, as well as of
text-decoration rendering in general.
The problem is we decorate the nsLineBox, which can have a negative width. If
we try to fill a negative-width rect, gfx gets all confused on us.
Per spec, we should be decorating the anonymous inline box that contains the
kids. This box starts after the text-indent and contains the child margins.
In other words, in this testcase we should have the following rendering:
First div: Just the letter "i" underlined
Second div: Just the letter "i" underlined
Third div: Nothing underlined (since the anonymous box has 0 width)
Fourth div: Nothing underlined (same reason).
I guess what we really need here is the computed text-indent... If we offset
for it and adjust the width to be painted by it, then check for
non-negativeness we should get the right results.
![]() |
Assignee | |
Updated•21 years ago
|
Attachment #161405 -
Attachment is obsolete: true
Attachment #162162 -
Attachment is obsolete: true
Attachment #162164 -
Attachment is obsolete: true
![]() |
Assignee | |
Comment 8•21 years ago
|
||
![]() |
Assignee | |
Comment 9•21 years ago
|
||
![]() |
Assignee | |
Comment 10•21 years ago
|
||
Comment on attachment 162327 [details] [diff] [review]
Same as diff -w
I took the opportunity to factor out the places that were looking for the
containing block into one place (esp. since they were doing it wrong for abs
pos kids of rel pos inlines).
Attachment #162327 -
Flags: superreview?(dbaron)
Attachment #162327 -
Flags: review?(dbaron)
![]() |
Assignee | |
Comment 11•21 years ago
|
||
Note that the GetContainingBlockFor() prototype should be returning a non-const
nsIFrame*. It's fixed locally and I'll make sure to check it in right.
![]() |
Assignee | |
Comment 12•21 years ago
|
||
Attachment #162266 -
Attachment is obsolete: true
Comment on attachment 162327 [details] [diff] [review]
Same as diff -w
r+sr=dbaron, although I'm wondering whether you're sure that all of these
callers can deal with the result being an inline. (They'll probably get the
wrong width for inlines with continuations -- and it's probably only fixing
that that would cause weird problems. But it's probably worth filing some
followup bugs.)
Attachment #162327 -
Flags: superreview?(dbaron)
Attachment #162327 -
Flags: superreview+
Attachment #162327 -
Flags: review?(dbaron)
Attachment #162327 -
Flags: review+
![]() |
Assignee | |
Comment 14•21 years ago
|
||
The existing callers can deal with it being an inline insofar as we just use the
first-in-flow of a rel pos inline as the abs pos containing block. So they'll
be looking at the frame we actually use...
If and when we change that, some of these callers will indeed need to be revisited.
Assignee: nobody → bzbarsky
OS: Windows XP → All
Priority: -- → P3
Hardware: PC → All
Target Milestone: --- → mozilla1.8alpha6
![]() |
Assignee | |
Comment 15•21 years ago
|
||
Checked in.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Comment 16•21 years ago
|
||
Might have been best to drop the helper function in layoututils. It looks a bit
weird in a (transient) reflow'state.
Reporter | ||
Comment 17•21 years ago
|
||
Verified fixed.
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8a6) Gecko/20041125
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a6) Gecko/20041125
Status: RESOLVED → VERIFIED
![]() |
Assignee | |
Comment 18•21 years ago
|
||
I think we want to move toward encapsulating a lot of the logic for these sort
of computations in the reflow state class or some class that reflow state uses
heavily... So it made more sese to put it there than the general utils class.
Comment 19•20 years ago
|
||
*** Bug 291783 has been marked as a duplicate of this bug. ***
![]() |
Assignee | |
Comment 20•20 years ago
|
||
*** Bug 291668 has been marked as a duplicate of this bug. ***
Comment 21•20 years ago
|
||
*** Bug 298710 has been marked as a duplicate of this bug. ***
You need to log in
before you can comment on or make changes to this bug.
Description
•