Open Bug 336705 Opened 18 years ago Updated 2 years ago

Problem with newline in-between tags in <pre>formatted text in display:table

Categories

(Core :: Layout: Block and Inline, defect)

x86
Windows 2000
defect

Tracking

()

People

(Reporter: zobier, Unassigned)

Details

(Keywords: testcase, Whiteboard: Need decision from CSS Working Group)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3

With shrink-wrapped (i.e. display: table for non ie browsers; width: 0 for ie) pre-formatted text containing tags at the end of one line and the beginning of the next, Firefox dishonours the newline in-between! The newline appears in the DOM tree (as an anonymous text node inbetween the two tags in question), it is just not rendered.

Reproducible: Always

Steps to Reproduce:
1. Create block with pre-formatted text.
   i.e. <pre> element, style="whitespace: pre"
2. Set style of pre-formatted block to include "display: table"
3. Add tag to end of one line and begining of next
   (whitespace doesn't appear to affect this issue)

Actual Results:  
 Line with a tag at the end -><- A tag at the beginning of line 


Expected Results:  
 Line with a tag at the end ->
 <- A tag at the beginning of line
Please see the attached file for demonstration of problem
I was stepping through firefox-1.5.0.3-debug, specifically in and around nsCSSFrameConstructor.cpp in an attempt to locate the offending code, and one of the times the browser actually exhibited the expected behaviour; I have been unable to reproduce this result so-far or to locate the code involved.
Version: Trunk → 1.8 Branch
Confirmed on Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060517 Minefield/3.0a1 ID:2006051706 [cairo]
 
 -> Trunk
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: testcase
Version: 1.8 Branch → Trunk
The display:table is key.  We skip over whitespace-only Text nodes when constructing the kids of a display:table frame so that for example:

  <table>
    <tr><td>Text</td></tr>
  </table>

Won't create three rows (two to hold the whitespace).

It's not clear what the correct behavior here is, in general; please bring this up on www-style@w3.org.
Summary: Problem with newline in-between tags in <pre>formatted text → Problem with newline in-between tags in <pre>formatted text in display:table
Whiteboard: Need decision from CSS Working Group
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: