Closed Bug 87391 Opened 24 years ago Closed 24 years ago

Whitespace is not properly discarded inside element tags

Categories

(Core :: CSS Parsing and Computation, defect)

PowerPC
Mac System 9.x
defect
Not set
normal

Tracking

()

VERIFIED INVALID

People

(Reporter: bugmail, Assigned: pierre)

References

()

Details

Attachments

(2 files)

From Bugzilla Helper: User-Agent: Mozilla/5.0 (Macintosh; U; PPC; en-US; rv:0.9.1) Gecko/20010607 BuildID: 2001060712 Whitespace immediately inside element tags is apparently not discarded when CSS2 :before and :after pseudoelements are applied. Reproducible: Always Steps to Reproduce: 1. Load the attached testcase into the Mozilla browser component. Actual Results: Whitespace is displayed between the exlamation point applied :before and :after the "div" element and those applied :before and :after the "p" elements. Expected Results: No whitespace should appear between the exclamation points. Mozilla is preserving the whitespace between the trailing </p> of p#b and the </div>, and displays it between the :after content of each. Said whitespace should be discarded. Since there's no whitespace between the initial "<div>" and the '<p id="a">', none is displayed.
Can you point to a section in the W3C specs that says this whitespace should be discarded? I looked but couldn't find any. It's not clear either way in the section on generated content, but since the initial value of 'display' for generated content is 'inline', then we should apply the rules for whitespace handling in inline elements. Those rules are very clear that the whitespace is significant. But like I said if there's somewhere in the spec that says otherwise, please point to it here so we can reference it.
I'm with Jason on this -- why should we remove those spaces?
Is any and all whitespace inside a block element treated as an anonymous inline block? As a simple case, consider <div> foo </div>. If so, then the existing rule seems to be that if it is leading or trailing whitespace, it is inconsequential and shall not be displayed, even though it is not discarded at parse time, but rather at layout time. In the example, only "foo" would be rendered with no leading or trailing whitespace. However, applying :before or :after content to the DIV adds something before or after the whitespace, and so the whitespace becomes significant, doesn't it? In that case, this bug is in error and may be closed as INVALID. Thanks for the discussion.
That is exactly how I understand it, Greg. Well said.
That's how I understand it too. Marking INVALID, feel free to VERIFY if you agree, or REOPEN if you don't.
Status: UNCONFIRMED → RESOLVED
Closed: 24 years ago
Resolution: --- → INVALID
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: