mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
changed the way white space was being compress when getting the value
now a value of all spaces does get compressed to nothing
This commit is contained in:
parent
d88c66a30a
commit
344f8d53df
@ -450,7 +450,15 @@ nsHTMLOptionElement::GetText(nsString& aText)
|
||||
rv = node->QueryInterface(kIDOMTextIID, (void**)&domText);
|
||||
if (NS_SUCCEEDED(rv) && domText) {
|
||||
rv = domText->GetData(aText);
|
||||
aText.CompressWhitespace(PR_TRUE, PR_TRUE);
|
||||
// the option could be all spaces, so compress the white space
|
||||
// then make sure the length is greater than zero
|
||||
if (aText.Length() > 0) {
|
||||
nsAutoString compressText = aText;
|
||||
compressText.CompressWhitespace(PR_TRUE, PR_TRUE);
|
||||
if (compressText.Length() != 0) {
|
||||
aText = compressText;
|
||||
}
|
||||
}
|
||||
NS_RELEASE(domText);
|
||||
NS_RELEASE(node);
|
||||
break;
|
||||
|
@ -450,7 +450,15 @@ nsHTMLOptionElement::GetText(nsString& aText)
|
||||
rv = node->QueryInterface(kIDOMTextIID, (void**)&domText);
|
||||
if (NS_SUCCEEDED(rv) && domText) {
|
||||
rv = domText->GetData(aText);
|
||||
aText.CompressWhitespace(PR_TRUE, PR_TRUE);
|
||||
// the option could be all spaces, so compress the white space
|
||||
// then make sure the length is greater than zero
|
||||
if (aText.Length() > 0) {
|
||||
nsAutoString compressText = aText;
|
||||
compressText.CompressWhitespace(PR_TRUE, PR_TRUE);
|
||||
if (compressText.Length() != 0) {
|
||||
aText = compressText;
|
||||
}
|
||||
}
|
||||
NS_RELEASE(domText);
|
||||
NS_RELEASE(node);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user