Enable inline event handlers for XHR, and add most progressevent calls

This commit is contained in:
Manish Goregaokar 2014-05-29 19:15:56 +05:30
parent 43beda87b2
commit 6f728cb2ca
5 changed files with 196 additions and 21 deletions

View file

@ -22,6 +22,11 @@ impl ByteString {
vector.as_slice()
}
pub fn len(&self) -> uint {
let ByteString(ref vector) = *self;
vector.len()
}
pub fn eq_ignore_case(&self, other: &ByteString) -> bool {
// XXXManishearth make this more efficient
self.to_lower() == other.to_lower()
@ -60,7 +65,7 @@ impl ByteString {
Other,
CR,
LF,
SP_HT // SP or HT
SPHT // SP or HT
}
let ByteString(ref vec) = *self;
let mut prev = Other; // The previous character
@ -68,7 +73,7 @@ impl ByteString {
// http://tools.ietf.org/html/rfc2616#section-2.2
match x {
13 => { // CR
if prev == Other || prev == SP_HT {
if prev == Other || prev == SPHT {
prev = CR;
true
} else {
@ -84,8 +89,8 @@ impl ByteString {
}
},
32 | 9 => { // SP | HT
if prev == LF || prev == SP_HT {
prev = SP_HT;
if prev == LF || prev == SPHT {
prev = SPHT;
true
} else {
false
@ -93,7 +98,7 @@ impl ByteString {
},
0..31 | 127 => false, // CTLs
x if x > 127 => false, // non ASCII
_ if prev == Other || prev == SP_HT => {
_ if prev == Other || prev == SPHT => {
prev = Other;
true
},