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)

x86
Windows XP
defect

Tracking

()

UNCONFIRMED

People

(Reporter: asefkow, Unassigned)

References

Details

(Keywords: testcase, Whiteboard: INVALID?)

Attachments

(1 file)

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>&lt;nobr&gt;STRING SURROUNDED BY NOBR&lt;/nobr&gt;&lt;nobr&gt;ANOTHER STRING SURROUNDED BY NOBR&lt;/nobr&gt;</tt></blockquote> <p>On IE, we get a line break BETWEEN the two &lt;nobr&gt;&lt;/nobr&gt 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.
Load this simple HTML file and make the window fairly narrow.
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.
<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...)
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.
*** Bug 263656 has been marked as a duplicate of this bug. ***
(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?
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?
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.
Blocks: 437115
This bug report came up as a top result in Google so I wanted to add a work around I found. &#8203; creates a zero width space that allows the line to break between nobr sets <nobr>random text - </nobr>&#8203;<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
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: