Closed Bug 245926 Opened 20 years ago Closed 11 years ago

whitespace in inline elements parsed incorrectly & coalesced badly

Categories

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

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: bmills, Unassigned)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624

Leading and trailing whitespace in inline elements is incorrect in some
instances and counterintuitive in some others.

Section B.3.1 in the HTML 4.01 spec says that line breaks immediately following
start tags and immediate preceding end tags must be ignored.  However, they are
not correctly ignored.  (See example 1 -- a should be identical to b.)

Whitespace should tend to coalesce to the outside, not to the left.  That is,
when coalescing trailing whitespace in a link and whitespace after the link's
closing tag, the whitespace after the closing tag should always be kept. 
Otherwise, two discrete links could *unintentionally* share a single underline
(see example 2).

example 3 is somewhat a matter of personal opinion, but I'd say that markup tags
should count as word separators -- especially things like images.  And separate
words should be rendered with a space between.

Example 4 shows the nasty, evil things that can happen when coalescing of
whitespace goes bad.  4a shows the mysterious disappearance of trailing
whitespace.  4b shows left-coalescing at its worst.  4c shows more or less
correct behaviour that is completely inconsistent with 4b.

Example 5 shows the effects of poor treatment of empty elements combined with
the effects of whitespace-coalescing.  Notice that eliminating the border in 5c
also, for reasons unknown, eliminates the whitespace.


Reproducible: Always
Steps to Reproduce:
View forthcoming attachment.
#1 is probably a duplicate
#2 is invalid, per CSS 2.1
#3 is also invalid
#4 and #5 may be invalid, depending on the definition of "at the beginning of a
line"

See http://www.w3.org/TR/2004/CR-CSS21-20040225/text.html#q8
And in the future, please limit yourself to one issue per bug.
In lieu of that CSS spec, #2 and #3 are in fact invalid (although I would argue
that that's a glaring problem in the CSS spec as it relates to stylistically
readable HTML code -- the placement of tags vs. whitespace in code should never
change the meaning of the code!).  I think that's actually an inconsistency
between the HTML spec and the CSS spec, but since the CSS is more explicit I'll
go along with it.

However, #1, #4, and #5 are definitely bugs because they are inconsistent --
especially the starting span tags that contain a single space but are rendered
with no space.  They are probably all symptoms of the same bug, which is why I
filed them all in the same bug report.
#1 is *very* different from #4 and #5.  In fact, it's very different from all
the other examples, and relates to an obscure SGML rule that nobody follows.
This is an automated message, with ID "auto-resolve01".

This bug has had no comments for a long time. Statistically, we have found that
bug reports that have not been confirmed by a second user after three months are
highly unlikely to be the source of a fix to the code.

While your input is very important to us, our resources are limited and so we
are asking for your help in focussing our efforts. If you can still reproduce
this problem in the latest version of the product (see below for how to obtain a
copy) or, for feature requests, if it's not present in the latest version and
you still believe we should implement it, please visit the URL of this bug
(given at the top of this mail) and add a comment to that effect, giving more
reproduction information if you have it.

If it is not a problem any longer, you need take no action. If this bug is not
changed in any way in the next two weeks, it will be automatically resolved.
Thank you for your help in this matter.

The latest beta releases can be obtained from:
Firefox:     http://www.mozilla.org/projects/firefox/
Thunderbird: http://www.mozilla.org/products/thunderbird/releases/1.5beta1.html
Seamonkey:   http://www.mozilla.org/projects/seamonkey/
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: