Auto merge of #18716 - jdm:parseSrcset, r=jdm

Parse srcset attribute values

Squashed version of #18313.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix (partially) #11416
- [x] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18716)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-10-04 07:32:53 -05:00 committed by GitHub
commit 1f9182507f
4 changed files with 280 additions and 2 deletions

View file

@ -58,7 +58,8 @@ pub fn split_commas<'a>(s: &'a str) -> Filter<Split<'a, char>, fn(&&str) -> bool
s.split(',').filter(not_empty as fn(&&str) -> bool)
}
fn is_ascii_digit(c: &char) -> bool {
/// Character is ascii digit
pub fn is_ascii_digit(c: &char) -> bool {
match *c {
'0'...'9' => true,
_ => false,