Comment 131 for bug 19250

Revision history for this message
In , Netdragon (netdragon) wrote :

Ian: I haven't played with the patch, nor is the spec very helpful when it comes
to character entities (they should mention how to handle character entities such
as line-feed and carriage return in specific cases like attributes.

This is my interpretation of what you should see:
<span title="yes&#10;no">test</span>

+---+
|yes|
|no |
+---+

<span title="yes
no">test</span>

+------+
|yes no|
+------+

This whole thing is where we run into a bit of something that isn't quite talked
about in enough detail in the spec. I'll give you a my interpretation:

* &#10; is the character code for line-feed, not a line-feed itself.
* We should honor &#10;, but ignore hard line-feeds of ascii char 10 (like you'd
get from a text editor).
* &#13; -- I have no clue what we should do with this, perhaps we should just
replace it with a space (This isn't specified anywhere that I can see).
* Ascii char 13 (hard carriage returns) should be replaced with a space.

I think they should provide more information on differentiation between
character codes and ascii chars for special print characters, but if IE and we
do it the same way, it'll become a de-facto standard.

Although the initial comment in bug 47078 referred to line breaks being replaced
with nothing, it might be the same issue. It depends on if the same patch would
handle both cases (if there is an issue). You'd have to look at the code.

Hixie:

Can w3c provide more details about this in the future? When it comes to
character codes for special chars in attributes and regular document text, there
seems to be a lot of grey area.

Correction:

I meant "printf and sprintf" in comment 129, not "printf and scanf".