dom: Append stream chunks in the correct order. (#33487)

* Append stream chunks in the correct order.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Run mimesniff tests in CI.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Delete tests/wpt/meta/mimesniff/media/media-sniff.window.js.ini

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Josh Matthews 2024-09-18 06:09:15 -04:00 committed by GitHub
parent 313fc663a6
commit aa5bf94b35
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 6563 additions and 2 deletions

View file

@ -470,8 +470,7 @@ impl ExternalUnderlyingSourceController {
fn enqueue_chunk(&self, cx: SafeJSContext, stream: HandleObject, mut chunk: Vec<u8>) {
let available = {
let mut buffer = self.buffer.borrow_mut();
chunk.append(&mut buffer);
*buffer = chunk;
buffer.append(&mut chunk);
buffer.len()
};
self.maybe_signal_available_bytes(cx, stream, available);

View file

@ -191,6 +191,8 @@ skip: true
skip: false
[mediasession]
skip: false
[mimesniff]
skip: false
[navigation-timing]
skip: false
[old-tests]

View file

@ -0,0 +1,48 @@
[charset-parameter.window.html]
[text/html;x=(;charset=gbk]
expected: FAIL
[text/html ;charset=gbk]
expected: FAIL
[text/html;charset= gbk]
expected: FAIL
[text/html;test;charset=gbk]
expected: FAIL
[text/html;test=;charset=gbk]
expected: FAIL
[text/html;';charset=gbk]
expected: FAIL
[text/html;";charset=gbk]
expected: FAIL
[text/html ; ; charset=gbk]
expected: FAIL
[text/html;;;;charset=gbk]
expected: FAIL
[text/html;charset= ";charset=GBK]
expected: FAIL
[text/html;charset=";charset=foo";charset=GBK]
expected: FAIL
[text/html;charset="gbk]
expected: FAIL
[text/html;charset="\\ gbk"]
expected: FAIL
[text/html;charset="\\g\\b\\k"]
expected: FAIL
[text/html;charset="gbk"x]
expected: FAIL
[text/html;test=ÿ;charset=gbk]
expected: FAIL

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,6 @@
[html.window.html]
[HTML is not sniffed for a "feed": atom]
expected: FAIL
[HTML is not sniffed for a "feed": rss]
expected: FAIL