Fix IgnoreWhitespace to handle leading/trailing.

@bug W-2105874@

@rev fabbott@
Merging origin/goliver/master-pending-ws-leading into master