Closed Bug 1213862 Opened 9 years ago Closed 9 years ago

Align XPCOM strings' idea of whitespace with web specs

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla44
Tracking Status
firefox44 --- fixed

People

(Reporter: ayg, Assigned: ayg)

Details

Attachments

(1 file)

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
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: