Closed
Bug 111609
Opened 23 years ago
Closed 22 years ago
newline (LF) in alt text displayed as square
Categories
(Core :: Layout, defect)
Tracking
()
Future
People
(Reporter: mmo, Assigned: attinasi)
References
()
Details
Attachments
(2 files)
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.6) Gecko/20011120
BuildID: 2001112009
A newline character is displayed as a square character instead of a space
when in ALT attribute.
Reproducible: Always
Steps to Reproduce:
1. Load given URL.
Actual Results: The following element is displayed with a "square" character
between the first and the second line:
<img width=400 height=100 src=none alt="first line
second line">
Expected Results: A space is expected.
Comment 2•23 years ago
|
||
What are other newlines in the file? Are the all LF, or are the rest CRLF?
Updated•23 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 3•23 years ago
|
||
The same thing happens with the "title" attribute. But the standard says:
The attribute value may only contain letters (a-z and A-Z), digits (0-9),
hyphens (ASCII decimal 45), periods (ASCII decimal 46), underscores (ASCII
decimal 95), and colons (ASCII decimal 58).
Is this also true for the alt tag?
Comment 4•23 years ago
|
||
Comment 5•23 years ago
|
||
Ahh, in bug 2756 this part of the standard is quoted:
CDATA is a sequence of characters from the document character set and
may include character entities. User agents should interpret attribute
values as follows:
o Replace character entities with characters,
o Ignore line feeds,
o Replace each carriage return or tab with a single space.
User agents may ignore leading and trailing white space in CDATA attribute
values (e.g., " myval " may be interpreted as "myval").
from http://www.w3.org/TR/REC-html40/types.html#h-6.2
Comment 6•23 years ago
|
||
Ok, that's how the testcase looks:
Opera 6 complete ignores the line feed
NS4 does not display a tooltip at all
MSIE displays the line feed as a line feed
My personal opinion is that it should be converted to a space.
Comment 7•23 years ago
|
||
Andre:
According to http://www.w3.org/TR/html4/struct/global.html#adef-title, title is
not CDATA, but Text, which matches what you first pasted here (which is from
http://www.w3.org/TR/html4/intro/sgmltut.html#attributes, linked from the last
URL you pasted)
The citation in comment #3 is not complete and AFAIK not relevant for this bug.
Here is the complete paragraph from
"http://www.w3.org/TR/html4/intro/sgmltut.html#attributes".
"In certain cases, authors may specify the value of an attribute without any
quotation marks. The attribute value may only contain letters (a-z and A-Z),
digits (0-9), hyphens (ASCII decimal 45), periods (ASCII decimal 46),
underscores (ASCII decimal 95), and colons (ASCII decimal 58). We recommend
using quotation marks even when it is possible to eliminate them."
Comment 9•23 years ago
|
||
Updated•23 years ago
|
Target Milestone: --- → Future
Comment 10•23 years ago
|
||
I believe that the quote in comment number 8 is not describing what can appear
as Text, but when it is permissible to omit the quotes.
Text in the HTML spec is a synonym for CDATA, at least at the level of the DTD,
so what should happen is covered here:
http://www.w3.org/TR/html4/types.html#type-cdata
Notice that with image alt text, this bug only occurs in quirks mode, and only
when the image has width and height attributes specified. See the test case that
I am about to attach
Comment 11•23 years ago
|
||
Comment 12•23 years ago
|
||
Note that the same applies to <abbr title="blabla
blabla" >blbl</abbr> at:
http://www.w3.org/TR/2001/WD-css3-box-20010726/
rest your mouse upon dotted W3C link and wait for the tooltip to appear.
Comment 13•22 years ago
|
||
Allthough there wasn't anyone caring about this bug for about half a year : Is
anyone working on fixing this ?
IE is handling this perfectly and web apps like phproject use this feature
heavily to output event data (as alt from img tags).
Bye,
Oliver
Comment 14•22 years ago
|
||
dup
*** This bug has been marked as a duplicate of 67127 ***
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•