Bug 1139560 - Fix srcset parser 'After descriptor' state mishandling spaces. r=jst

This commit is contained in:
John Schoenick 2015-03-04 23:11:00 -05:00
parent 47ba37744a
commit e974724ccd

View File

@ -621,11 +621,13 @@ ResponsiveImageCandidate::ConsumeDescriptors(nsAString::const_iterator& aIter,
// End of current descriptor, consume it, skip spaces
// ("After descriptor" state in spec) before continuing
descriptors.AddDescriptor(Substring(currentDescriptor, iter));
for (; iter != end && *iter == char16_t(' '); ++iter);
for (; iter != end && nsContentUtils::IsHTMLWhitespace(*iter); ++iter);
if (iter == end) {
break;
}
currentDescriptor = iter;
// Leave one whitespace so the loop advances to this position next iteration
iter--;
} else if (*iter == char16_t('(')) {
inParens = true;
}