diff options
author | Manish Goregaokar <manishsmail@gmail.com> | 2014-06-10 21:07:44 +0530 |
---|---|---|
committer | Manish Goregaokar <manishsmail@gmail.com> | 2014-06-21 09:33:17 +0530 |
commit | 7d029ae7b2b350b515038ae48c35340cbf26ad9c (patch) | |
tree | bf26443c576012329aa9a44c95b2ea13cbc7cb66 | |
parent | afb6bf48e761d2dcaf307a123fe4a8f2a79b645f (diff) | |
download | servo-7d029ae7b2b350b515038ae48c35340cbf26ad9c.tar.gz servo-7d029ae7b2b350b515038ae48c35340cbf26ad9c.zip |
Fix field-value checking to not throw for lone spaces
-rw-r--r-- | src/components/script/dom/bindings/str.rs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/components/script/dom/bindings/str.rs b/src/components/script/dom/bindings/str.rs index ae6c721abea..6db3f6c1f97 100644 --- a/src/components/script/dom/bindings/str.rs +++ b/src/components/script/dom/bindings/str.rs @@ -94,7 +94,21 @@ impl ByteString { false } }, - 32 | 9 => { // SP | HT + 32 => { // SP + if prev == LF || prev == SPHT { + prev = SPHT; + true + } else if prev == Other { + // Counts as an Other here, since it's not preceded by a CRLF + // SP is not a CTL, so it can be used anywhere + // though if used immediately after a CR the CR is invalid + // We don't change prev since it's already Other + true + } else { + false + } + }, + 9 => { // HT if prev == LF || prev == SPHT { prev = SPHT; true |