Open
Bug 256643
Opened 21 years ago
Updated 3 years ago
No line break possible after </nobr> before the next <nobr> that immediately follows
Categories
(Core :: Layout: Block and Inline, defect)
Tracking
()
UNCONFIRMED
People
(Reporter: asefkow, Unassigned)
References
Details
(Keywords: testcase, Whiteboard: INVALID?)
Attachments
(1 file)
|
817 bytes,
text/html
|
Details |
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax)
Put something like this inside a <table>
<tr><td><nobr>STRING SURROUNDED BY NOBR</nobr><nobr>ANOTHER STRING SURROUNDED
BY NOBR</nobr></td><td>random text here</td></tr>
and you will see odd results when making your browser window small (narrow).
First, there is no line break after the first string, and in fact the first
string starts to overwrite the second string -- you have to see it!
Reproducible: Always
Steps to Reproduce:
Create a web page with this HTML:
<html>
<head>
</head>
<body>
<p>Resize the browser window so that the contents of the table begin to wrap.
<p>The value in the first row of the first column looks like this:
<p><blockquote><tt><nobr>STRING SURROUNDED BY
NOBR</nobr><nobr>ANOTHER STRING SURROUNDED BY
NOBR</nobr></tt></blockquote>
<p>On IE, we get a line break BETWEEN the two <nobr></nobr> groups.
<p>On Mozilla 1.7, it never breaks, and the first cell's contents overwrites
the second!!
<br>
<br>
<table border=1>
<tr>
<td><nobr>STRING SURROUNDED BY NOBR</nobr><nobr>ANOTHER STRING SURROUNDED BY
NOBR</nobr></td><td>random text here</td>
</tr>
<tr>
<td><nobr>short string w/nobr</nobr><nobr>shorter still</nobr></td><td>the
second column in the second row</td>
</tr>
</table>
</body>
</html>
AND THEN MAKE THE BROWSER WINDOW FAIRLY NARROW
Actual Results:
THe text in the first cell of the first row does NOT wrap as it should, and
the text overwrites the contents of the second cell.
Expected Results:
Same as IE -- the first cel should wrap.
Originally reported in Netscape 7.2 (sorry) but I have since verified that it
reproduces in Mozilla 1.72 as well, as you might expect:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040803
Even using <span style="white-space:nowrap"> instead of the deprecated <nobr>
does not change anything.
Comment 4•21 years ago
|
||
<nobr> has been treated as an inline element since at least Netscape 4, I
believe. So there's no break between sets of <nobr>'s.
Sounds like IE treats it as a block element.
Or that it specifically allows a break at the edge even when there's no space.
(Not that we don't do similar things sometimes...)
Comment 6•21 years ago
|
||
For white-space:nowrap, this would be correct behaviour. You can only wrap at a
white-space:normal space, if there is no space, there's no wrapping.
Comment 7•21 years ago
|
||
*** Bug 263656 has been marked as a duplicate of this bug. ***
Comment 8•21 years ago
|
||
(In reply to comment #4)
> <nobr> has been treated as an inline element since at least Netscape 4, I
> believe. So there's no break between sets of <nobr>'s.
>
> Sounds like IE treats it as a block element.
It doesn't break when there's enough space to fit the entire word though, would
this still comply with a block element's properties?
Comment 9•21 years ago
|
||
This bug is invalid IMO - "NOBR</nobr><nobr>ANOTHER" is one word.
Opera, Konqueror and Netscape 4.8 all have this behaviour too.
Keywords: testcase
Whiteboard: INVALID?
| Reporter | ||
Comment 10•20 years ago
|
||
Aside from the debate of whether the line should break or not, why is the text in the first cell overwriting the text in the second cell? The width of the first cell seems to be governed by the text inside the first <nobr>...</nobr>, as if the second did not exist. Hard to explain, just have a look at testcase (make browser window narrow).
If I remove the "</nobr><nobr>" from the first cell, then I get something more normal-looking.
Comment 11•11 years ago
|
||
This bug report came up as a top result in Google so I wanted to add a work around I found.
​ creates a zero width space that allows the line to break between nobr sets
<nobr>random text - </nobr>​<nobr>more text</nobr>
<wbr> is another solution but has poor browser support but the following css can be used
wbr:after {content:"\00200B";}
Source: http://reference.sitepoint.com/html/wbr
Updated•3 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•