Align XPCOM strings' idea of whitespace with web specs

RESOLVED FIXED in Firefox 44

Status

()

Core
XPCOM
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: ayg, Assigned: ayg)

Tracking

unspecified
mozilla44
Points:
---

Firefox Tracking Flags

(firefox44 fixed)

Details

Attachments

(1 attachment)

The HTML and DOM specs define ASCII whitespace to be any of "\f\t\r\n ".  nsStringObsolete.cpp (the name seems misleading?) defines it to be "\b\t\r\n ".  Changing XPCOM to match the specs causes some unexpected passes and no unexpected fails:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=7d58db02475a

I doubt anything internal will break if we slightly change how we handle backspace vs. form feed, and it makes things easier to be consistent in what we consider whitespace, so I suggest just changing XPCOM.
Comment on attachment 8672624 [details] [diff] [review]
Patch

Review of attachment 8672624 [details] [diff] [review]:
-----------------------------------------------------------------

r=me assuming tests are green.

::: xpcom/string/nsStringObsolete.cpp
@@ -539,5 @@
>  }
>  
>  /* ***** END RICKG BLOCK ***** */
>  
> -static const char* kWhitespace="\b\t\r\n ";

I'm sure this made sense at some point, but it sure seems odd reading it now.
Attachment #8672624 - Flags: review?(nfroyd) → review+
https://hg.mozilla.org/mozilla-central/rev/b69f59c4391f
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
status-firefox44: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in before you can comment on or make changes to this bug.