Bug 416749 - Place <wbr> tags after each processed section of text, as well as in the middle, so that lots of short processed text chunks will still wrap. p=krishean@gmail.com (krishean) r=silver ChatZilla only.

git-svn-id: svn://10.0.0.236/trunk@252466 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
silver%warwickcompsoc.co.uk 2008-06-20 12:25:06 +00:00
parent 82bdd0ad01
commit b54d887bac

View File

@ -656,15 +656,10 @@ function insertHyphenatedWord(longWord, containerTag, data)
if (data && ("hasColorInfo" in data))
newClass = calcClass(data);
var wbr = document.createElementNS("http://www.w3.org/1999/xhtml",
"html:wbr");
for (var i = 0; i < wordParts.length; ++i)
{
if (i > 0)
{
var wbr = document.createElementNS("http://www.w3.org/1999/xhtml",
"html:wbr");
containerTag.appendChild(wbr);
}
if (newClass)
{
var newTag = document.createElementNS(NS_XHTML, "html:span");
@ -677,6 +672,7 @@ function insertHyphenatedWord(longWord, containerTag, data)
delete data.hasColorInfo;
containerTag.appendChild(document.createTextNode(wordParts[i]));
}
containerTag.appendChild(wbr.cloneNode(true));
}
}