mirror of
https://github.com/servo/servo
synced 2026-05-09 00:22:16 +02:00
The patch implements Compression (https://compression.spec.whatwg.org/) with the compression and decompression provided by the `flate2` crate (https://crates.io/crates/flate2). `flate2` supports several different backends, controlled through the crate's features. By default, it uses `miniz_oxide` (https://crates.io/crates/miniz_oxide). `flate2` provides three modules `read`, `write` and `bufread` which work on instances of the `std::io::Read`, `std::io::Write` and `std::io::Bufread` traits, respectively. The `write` module is chosen in the patch since it matches the streaming model in the specification. Testing: Enable WPT for Compression API, and introduce WPT expectation. --------- Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
18 lines
546 B
Plaintext
18 lines
546 B
Plaintext
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
|
|
// https://compression.spec.whatwg.org/#enumdef-compressionformat
|
|
enum CompressionFormat {
|
|
"deflate",
|
|
"deflate-raw",
|
|
"gzip",
|
|
};
|
|
|
|
// https://compression.spec.whatwg.org/#compressionstream
|
|
[Exposed=*]
|
|
interface CompressionStream {
|
|
[Throws] constructor(CompressionFormat format);
|
|
};
|
|
CompressionStream includes GenericTransformStream;
|