From 34d39f1df8cd1e35e2a69bbc770da21ede1bd829 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Tue, 28 May 2024 07:04:34 +0200 Subject: [PATCH] Meta: initial spec-factory run Compression standard This removes files that are now redundant as well. --- .editorconfig | 22 + .gitattributes | 2 + .github/ISSUE_TEMPLATE/0-new-issue.yml | 17 + .github/ISSUE_TEMPLATE/1-new-feature.yml | 27 + .github/ISSUE_TEMPLATE/config.yml | 8 + .github/workflows/build.yml | 29 + .gitignore | 3 + .nojekyll | 0 .pr-preview.json | 7 +- CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 23 - LICENSE | 356 +++++ LICENSE.md | 10 - Makefile | 13 +- PULL_REQUEST_TEMPLATE.md | 19 + README.md | 38 +- index.html | 1634 ---------------------- w3c.json | 5 - 18 files changed, 531 insertions(+), 1685 deletions(-) create mode 100644 .editorconfig create mode 100644 .gitattributes create mode 100644 .github/ISSUE_TEMPLATE/0-new-issue.yml create mode 100644 .github/ISSUE_TEMPLATE/1-new-feature.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/workflows/build.yml create mode 100644 .gitignore delete mode 100644 .nojekyll delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md create mode 100644 LICENSE delete mode 100644 LICENSE.md create mode 100644 PULL_REQUEST_TEMPLATE.md delete mode 100644 index.html delete mode 100644 w3c.json diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..df39c7c --- /dev/null +++ b/.editorconfig @@ -0,0 +1,22 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true +charset = utf-8 +indent_size = 2 +indent_style = space +trim_trailing_whitespace = true +max_line_length = 100 + +[Makefile] +indent_style = tab + +[*.md] +max_line_length = off + +[*.bs] +indent_size = 1 + +[*.py] +indent_size = 4 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..2f2e77e --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +* text=auto +*.bs diff=html linguist-language=HTML diff --git a/.github/ISSUE_TEMPLATE/0-new-issue.yml b/.github/ISSUE_TEMPLATE/0-new-issue.yml new file mode 100644 index 0000000..46dfd5f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/0-new-issue.yml @@ -0,0 +1,17 @@ +name: New issue +description: File a new issue against the Compression Standard. +body: + - type: markdown + attributes: + value: | + Before filling out this form, please familiarize yourself with the [Code of Conduct](https://whatwg.org/code-of-conduct). You might also find the [FAQ](https://whatwg.org/faq) and [Working Mode](https://whatwg.org/working-mode) useful. + + If at any point you have questions, please reach out to us on [Chat](https://whatwg.org/chat). + - type: textarea + attributes: + label: "What is the issue with the Compression Standard?" + validations: + required: true + - type: markdown + attributes: + value: "Thank you for taking the time to improve the Compression Standard!" diff --git a/.github/ISSUE_TEMPLATE/1-new-feature.yml b/.github/ISSUE_TEMPLATE/1-new-feature.yml new file mode 100644 index 0000000..674fcdd --- /dev/null +++ b/.github/ISSUE_TEMPLATE/1-new-feature.yml @@ -0,0 +1,27 @@ +name: New feature +description: Request a new feature in the Compression Standard. +labels: ["addition/proposal", "needs implementer interest"] +body: + - type: markdown + attributes: + value: | + Before filling out this form, please familiarize yourself with the [Code of Conduct](https://whatwg.org/code-of-conduct), [FAQ](https://whatwg.org/faq), and [Working Mode](https://whatwg.org/working-mode). They help with setting expectations and making sure you know what is required. The FAQ ["How should I go about proposing new features to WHATWG standards?"](https://whatwg.org/faq#adding-new-features) is especially relevant. + + If at any point you have questions, please reach out to us on [Chat](https://whatwg.org/chat). + - type: textarea + attributes: + label: "What problem are you trying to solve?" + validations: + required: true + - type: textarea + attributes: + label: "What solutions exist today?" + - type: textarea + attributes: + label: "How would you solve it?" + - type: textarea + attributes: + label: "Anything else?" + - type: markdown + attributes: + value: "Thank you for taking the time to improve the Compression Standard!" diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..70e8d0d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: false +contact_links: + - name: Chat + url: https://whatwg.org/chat + about: Please do reach out with questions and feedback! + - name: Stack Overflow + url: https://stackoverflow.com/ + about: If you're having trouble building a web page, this is not the right repository. Consider asking your question on Stack Overflow instead. diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..66fe55b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,29 @@ +name: Build + +on: + pull_request: + branches: + - main + push: + branches: + - main + workflow_dispatch: + +jobs: + build: + name: Build + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + - uses: actions/setup-python@v4 + with: + python-version: "3.11" + - run: pip install bikeshed && bikeshed update + # Note: `make deploy` will do a deploy dry run on PRs. + - run: make deploy + env: + SERVER: ${{ secrets.MARQUEE_SERVER }} + SERVER_PUBLIC_KEY: ${{ secrets.MARQUEE_PUBLIC_KEY }} + SERVER_DEPLOY_KEY: ${{ secrets.MARQUEE_DEPLOY_KEY }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..87aad43 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/compression.spec.whatwg.org/ +/deploy.sh +/index.html diff --git a/.nojekyll b/.nojekyll deleted file mode 100644 index e69de29..0000000 diff --git a/.pr-preview.json b/.pr-preview.json index 654806a..3b9efb1 100644 --- a/.pr-preview.json +++ b/.pr-preview.json @@ -1,4 +1,9 @@ { "src_file": "index.bs", - "type": "bikeshed" + "type": "bikeshed", + "params": { + "force": 1, + "md-status": "LS-PR", + "md-Text-Macro": "PR-NUMBER {{ pull_request.number }}" + } } diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index 04f41dc..0000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,3 +0,0 @@ -# Code of Conduct - -All documentation, code and communication under this repository are covered by the [W3C Code of Ethics and Professional Conduct](https://www.w3.org/Consortium/cepc/). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index e8563f2..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,23 +0,0 @@ -# Web Platform Incubator Community Group - -This repository is being used for work in the W3C Web Platform Incubator Community Group, governed by the [W3C Community License -Agreement (CLA)](http://www.w3.org/community/about/agreements/cla/). To make substantive contributions, -you must join the CG. - -If you are not the sole contributor to a contribution (pull request), please identify all -contributors in the pull request comment. - -To add a contributor (other than yourself, that's automatic), mark them one per line as follows: - -``` -+@github_username -``` - -If you added a contributor by mistake, you can remove them in a comment with: - -``` --@github_username -``` - -If you are making a pull request on behalf of someone else but you had no part in designing the -feature, you can remove yourself with the above syntax. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f2dcda4 --- /dev/null +++ b/LICENSE @@ -0,0 +1,356 @@ +Copyright © WHATWG (Apple, Google, Mozilla, Microsoft). + +This work is licensed under a Creative Commons Attribution 4.0 International +License. To the extent portions of it are incorporated into source code, +such portions in the source code are licensed under the BSD 3-Clause License instead. + +- - - - + +Creative Commons Attribution 4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution 4.0 International Public License ("Public License"). To the +extent this Public License may be interpreted as a contract, You are +granted the Licensed Rights in consideration of Your acceptance of +these terms and conditions, and the Licensor grants You such rights in +consideration of benefits the Licensor receives from making the +Licensed Material available under these terms and conditions. + + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright + and Similar Rights in Your contributions to Adapted Material in + accordance with the terms and conditions of this Public License. + + c. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + + d. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + + e. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + + f. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + + g. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + + h. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + + i. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + + j. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + + k. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + + +Section 2 -- Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part; and + + b. produce, reproduce, and Share Adapted Material. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties. + + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified + form), You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + 4. If You Share Adapted Material You produce, the Adapter's + License You apply must not prevent recipients of the Adapted + Material from complying with this Public License. + + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database; + + b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material; and + + c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + + c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + + +Section 6 -- Term and Termination. + + a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + + c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + + +Section 7 -- Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + + +Section 8 -- Interpretation. + + a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + + c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + + d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. + +- - - - + +BSD 3-Clause License + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +- - - - diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100644 index ca197c0..0000000 --- a/LICENSE.md +++ /dev/null @@ -1,10 +0,0 @@ -All Reports in this Repository are licensed by Contributors -under the -[W3C Software and Document License](http://www.w3.org/Consortium/Legal/2015/copyright-software-and-document). - -Contributions to Specifications are made under the -[W3C CLA](https://www.w3.org/community/about/agreements/cla/). - -Contributions to Test Suites are made under the -[W3C 3-clause BSD License](https://www.w3.org/Consortium/Legal/2008/03-bsd-license.html) - diff --git a/Makefile b/Makefile index 7689ebe..d562a17 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,23 @@ -SHELL=/bin/bash +SHELL=/bin/bash -o pipefail +.PHONY: local remote deploy -index.html: index.bs +remote: index.bs @ (HTTP_STATUS=$$(curl https://api.csswg.org/bikeshed/ \ --output index.html \ --write-out "%{http_code}" \ --header "Accept: text/plain, text/html" \ -F die-on=warning \ + -F md-Text-Macro="COMMIT-SHA LOCAL COPY" \ -F file=@index.bs) && \ [[ "$$HTTP_STATUS" -eq "200" ]]) || ( \ echo ""; cat index.html; echo ""; \ rm -f index.html; \ exit 22 \ ); + +local: index.bs + bikeshed spec index.bs index.html --md-Text-Macro="COMMIT-SHA LOCAL-COPY" + +deploy: index.bs + curl --remote-name --fail https://resources.whatwg.org/build/deploy.sh + bash ./deploy.sh diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..bf37277 --- /dev/null +++ b/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,19 @@ + + +- [ ] At least two implementers are interested (and none opposed): + * … + * … +- [ ] [Tests](https://github.com/web-platform-tests/wpt) are written and can be reviewed and commented upon at: + * … +- [ ] [Implementation bugs](https://github.com/whatwg/meta/blob/main/MAINTAINERS.md#handling-pull-requests) are filed: + * Chromium: … + * Gecko: … + * WebKit: … +- [ ] [MDN issue](https://github.com/whatwg/meta/blob/main/MAINTAINERS.md#handling-pull-requests) is filed: … +- [ ] The top of this comment includes a [clear commit message](https://github.com/whatwg/meta/blob/main/COMMITTING.md) to use. + +(See [WHATWG Working Mode: Changes](https://whatwg.org/working-mode#changes) for more details.) diff --git a/README.md b/README.md index 903b22a..992c635 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,33 @@ -# Compression Streams Specification +This repository hosts the [Compression Standard](https://compression.spec.whatwg.org/). -This repository is the home of the Compression Streams Specification, -which defines the APIs CompressionStream and DecompressionStream. +## Code of conduct -See the [text of the specification](https://wicg.github.io/compression/) or -read [the -explainer](https://github.com/wicg/compression/blob/master/explainer.md) -to find out what this is all about. +We are committed to providing a friendly, safe, and welcoming environment for all. Please read and respect the [Code of Conduct](https://whatwg.org/code-of-conduct). + +## Contribution opportunities + +Folks notice minor and larger issues with the Compression Standard all the time and we'd love your help fixing those. Pull requests for typographical and grammar errors are also most welcome. + +Issues labeled ["good first issue"](https://github.com/whatwg/compression/labels/good%20first%20issue) are a good place to get a taste for editing the Compression Standard. Note that we don't assign issues and there's no reason to ask for availability either, just provide a pull request. + +If you are thinking of suggesting a new feature, read through the [FAQ](https://whatwg.org/faq) and [Working Mode](https://whatwg.org/working-mode) documents to get yourself familiarized with the process. + +We'd be happy to help you with all of this [on Chat](https://whatwg.org/chat). + +## Pull requests + +In short, change `index.bs` and submit your patch, with a [good commit message](https://github.com/whatwg/meta/blob/main/COMMITTING.md). + +Please add your name to the Acknowledgments section in your first pull request, even for trivial fixes. The names are sorted lexicographically. + +To ensure your patch meets all the necessary requirements, please also see the [Contributor Guidelines](https://github.com/whatwg/meta/blob/main/CONTRIBUTING.md). Editors of the Compression Standard are expected to follow the [Maintainer Guidelines](https://github.com/whatwg/meta/blob/main/MAINTAINERS.md). + +## Tests + +Tests are an essential part of the standardization process and will need to be created or adjusted as changes to the standard are made. Tests for the Compression Standard can be found in the `compression/` directory of [`web-platform-tests/wpt`](https://github.com/web-platform-tests/wpt). + +A dashboard showing the tests running against browser engines can be seen at [wpt.fyi/results/compression](https://wpt.fyi/results/compression). + +## Building "locally" + +For quick local iteration, run `make`; this will use a web service to build the standard, so that you don't have to install anything. See more in the [Contributor Guidelines](https://github.com/whatwg/meta/blob/main/CONTRIBUTING.md#building). diff --git a/index.html b/index.html deleted file mode 100644 index 0a39dba..0000000 --- a/index.html +++ /dev/null @@ -1,1634 +0,0 @@ - - - - Compression Streams - - - - - - - - - - - - - - - -
-

-

Compression Streams

-

Draft Community Group Report,

-
-
-
This version: -
https://wicg.github.io/compression/ -
Issue Tracking: -
GitHub -
Editors: -
Canon Mukai (Google) -
Adam Rice (Google) -
-
-
- -
-
-
-

Abstract

-

This document defines a set of JavaScript APIs to compress and decompress - - streams of binary data.

-
-
-

Status of this document

-
-

This specification was published by the Web Platform Incubator Community Group. - It is not a W3C Standard nor is it on the W3C Standards Track. - - Please note that under the W3C Community Contributor License Agreement (CLA) there is a limited opt-out and other conditions apply. - - Learn more about W3C Community and Business Groups.

-

-
-
- -
-

1. Introduction

-

This section is non-normative.

-

The APIs specified in this specification are used to compress and decompress streams of data. They support "deflate", "deflate-raw" and "gzip" as compression algorithms. They are widely used by web developers.

-

2. Conformance

-

As well as sections marked as non-normative, all authoring guidelines, -diagrams, examples, and notes in this specification are non-normative. -Everything else in this specification is normative.

-

The key words MUST and SHOULD are to be interpreted as described in [RFC2119].

-

This specification defines conformance criteria that apply to a single product: -the user agent that implements the interfaces that it contains.

-

Conformance requirements phrased as algorithms or specific steps may be -implemented in any manner, so long as the end result is equivalent. (In -particular, the algorithms defined in this specification are intended to be -easy to follow, and not intended to be performant.)

-

Implementations that use ECMAScript to implement the APIs defined in this -specification MUST implement them in a manner consistent with the ECMAScript -Bindings defined in the Web IDL specification [WebIDL], as this -specification uses that specification and terminology.

-

3. Terminology

-

A chunk is a piece of data. In the case of CompressionStream and DecompressionStream, the output chunk type is Uint8Array. They accept any BufferSource type as input.

-

A stream represents an ordered sequence of chunks. The terms ReadableStream and WritableStream are defined in [WHATWG-STREAMS].

-

A compression context is the internal state maintained by a compression or decompression algorithm. The contents of a compression context depend on the format, algorithm and implementation in use. From the point of view of this specification, it is an opaque object. A compression context is initially in a start state such that it anticipates the first byte of input.

-

4. Supported formats

-
-
deflate -
-

"ZLIB Compressed Data Format" [RFC1950]

-

Note: This format is referred to as "deflate" for consistency with HTTP Content-Encodings. See [RFC7230] section 4.2.2.

-
    -
  • -

    Implementations must be "compliant" as described in [RFC1950] section 2.3.

    -
  • -

    Field values described as invalid in [RFC1950] must not be created by CompressionStream, and are errors for DecompressionStream.

    -
  • -

    The only valid value of the CM (Compression method) part of the CMF field is 8.

    -
  • -

    The FDICT flag is not supported by these APIs, and will error the stream if set.

    -
  • -

    The FLEVEL flag is ignored by DecompressionStream.

    -
  • -

    It is an error for DecompressionStream if the ADLER32 checksum is not correct.

    -
  • -

    It is an error if there is additional input data after the ADLER32 checksum.

    -
-
deflate-raw -
-

"The DEFLATE algorithm" [RFC1951]

-
    -
  • -

    Implementations must be "compliant" as described in [RFC1951] section 1.4.

    -
  • -

    Non-[RFC1951]-conforming blocks must not be created by CompressionStream, and are errors for DecompressionStream.

    -
  • -

    It is an error if there is additional input data after the final block indicated by the BFINAL flag.

    -
-
gzip -
-

"GZIP file format" [RFC1952]

-
    -
  • -

    Implementations must be "compliant" as described in [RFC1952] section 2.3.1.2.

    -
  • -

    Field values described as invalid in [RFC1952] must not be created by CompressionStream, and are errors for DecompressionStream.

    -
  • -

    The only valid value of the CM (Compression Method) field is 8.

    -
  • -

    The FTEXT flag must be ignored by DecompressionStream.

    -
  • -

    If the FHCRC field is present, it is an error for it to be incorrect.

    -
  • -

    The contents of any FEXTRA, FNAME and FCOMMENT fields must be ignored by DecompressionStream, except to verify that they are terminated correctly.

    -
  • -

    The contents of the MTIME, XFL and OS fields must be ignored by DecompressionStream.

    -
  • -

    It is an error if CRC32 or ISIZE do not match the decompressed data.

    -
  • -

    A gzip stream may only contain one "member".

    -
  • -

    It is an error if there is additional input data after the end of the "member".

    -
-
-

5. Interface CompressionStream

-
enum CompressionFormat {
-  "deflate",
-  "deflate-raw",
-  "gzip",
-};
-
-[Exposed=*]
-interface CompressionStream {
-  constructor(CompressionFormat format);
-};
-CompressionStream includes GenericTransformStream;
-
-

A CompressionStream has an associated format and compression context context.

-

The new CompressionStream(format) steps are:

-
    -
  1. -

    If format is unsupported in CompressionStream, then throw a TypeError.

    -
  2. -

    Set this's format to format.

    -
  3. -

    Let transformAlgorithm be an algorithm which takes a chunk argument and runs the compress and enqueue a chunk algorithm with this and chunk.

    -
  4. -

    Let flushAlgorithm be an algorithm which takes no argument and runs the compress flush and enqueue algorithm with this.

    -
  5. -

    Set this's transform to a new TransformStream.

    -
  6. -

    Set up this's transform with transformAlgorithm set to transformAlgorithm and flushAlgorithm set to flushAlgorithm.

    -
-

The compress and enqueue a chunk algorithm, given a CompressionStream object cs and a chunk, runs these steps:

-
    -
  1. -

    If chunk is not a BufferSource type, then throw a TypeError.

    -
  2. -

    Let buffer be the result of compressing chunk with cs's format and context.

    -
  3. -

    If buffer is empty, return.

    -
  4. -

    Split buffer into one or more non-empty pieces and convert them into Uint8Arrays.

    -
  5. -

    For each Uint8Array array, enqueue array in cs's transform.

    -
-

The compress flush and enqueue algorithm, which handles the end of data from the input ReadableStream object, given a CompressionStream object cs, runs these steps:

-
    -
  1. -

    Let buffer be the result of compressing an empty input with cs's format and context, with the finish flag.

    -
  2. -

    If buffer is empty, return.

    -
  3. -

    Split buffer into one or more non-empty pieces and convert them into Uint8Arrays.

    -
  4. -

    For each Uint8Array array, enqueue array in cs's transform.

    -
-

6. Interface DecompressionStream

-
[Exposed=*]
-interface DecompressionStream {
-  constructor(CompressionFormat format);
-};
-DecompressionStream includes GenericTransformStream;
-
-

A DecompressionStream has an associated format and compression context context.

-

The new DecompressionStream(format) steps are:

-
    -
  1. -

    If format is unsupported in DecompressionStream, then throw a TypeError.

    -
  2. -

    Set this's format to format.

    -
  3. -

    Let transformAlgorithm be an algorithm which takes a chunk argument and runs the decompress and enqueue a chunk algorithm with this and chunk.

    -
  4. -

    Let flushAlgorithm be an algorithm which takes no argument and runs the decompress flush and enqueue algorithm with this.

    -
  5. -

    Set this's transform to a new TransformStream.

    -
  6. -

    Set up this's transform with transformAlgorithm set to transformAlgorithm and flushAlgorithm set to flushAlgorithm.

    -
-

The decompress and enqueue a chunk algorithm, given a DecompressionStream object ds and a chunk, runs these steps:

-
    -
  1. -

    If chunk is not a BufferSource type, then throw a TypeError.

    -
  2. -

    Let buffer be the result of decompressing chunk with ds's format and context. If this results in an error, then throw a TypeError.

    -
  3. -

    If buffer is empty, return.

    -
  4. -

    Split buffer into one or more non-empty pieces and convert them into Uint8Arrays.

    -
  5. -

    For each Uint8Array array, enqueue array in ds's transform.

    -
-

The decompress flush and enqueue algorithm, which handles the end of data from the input ReadableStream object, given a DecompressionStream object ds, runs these steps:

-
    -
  1. -

    Let buffer be the result of decompressing an empty input with ds's format and context, with the finish flag.

    -
  2. -

    If the end of the compressed input has not been reached, then throw a TypeError.

    -
  3. -

    If buffer is empty, return.

    -
  4. -

    Split buffer into one or more non-empty pieces and convert them into Uint8Arrays.

    -
  5. -

    For each Uint8Array array, enqueue array in ds's transform.

    -
-

7. Privacy and Security Considerations

-

The API doesn’t add any new privileges to the web platform.

-

However, web developers have to pay attention to the situation when attackers can get the length of the data. If so, they may be able to guess the contents of the data.

-

8. Examples

-

8.1. Gzip-compress a stream

-
const compressedReadableStream
-    = inputReadableStream.pipeThrough(new CompressionStream('gzip'));
-
-

8.2. Deflate-compress an ArrayBuffer to a Uint8Array

-
async function compressArrayBuffer(input) {
-  const cs = new CompressionStream('deflate');
-  const writer = cs.writable.getWriter();
-  writer.write(input);
-  writer.close();
-  const output = [];
-  const reader = cs.readable.getReader();
-  let totalSize = 0;
-  while (true) {
-    const { value, done } = await reader.read();
-    if (done)
-      break;
-    output.push(value);
-    totalSize += value.byteLength;
-  }
-  const concatenated = new Uint8Array(totalSize);
-  let offset = 0;
-  for (const array of output) {
-    concatenated.set(array, offset);
-    offset += array.byteLength;
-  }
-  return concatenated;
-}
-
-

8.3. Gzip-decompress a Blob to Blob

-
function decompressBlob(blob) {
-  const ds = new DecompressionStream('gzip');
-  const decompressionStream = blob.stream().pipeThrough(ds);
-  return new Response(decompressionStream).blob();
-}
-
-

9. Acknowledgments

- The editors wish to thank Domenic Denicola and Yutaka Hirano, for their support. -
- -

Index

-

Terms defined by this specification

- - - - - - - - - - - - - - - -

Terms defined by reference

- -

References

-

Normative References

-
-
[RFC1950] -
P. Deutsch; J-L. Gailly. ZLIB Compressed Data Format Specification version 3.3. May 1996. Informational. URL: https://www.rfc-editor.org/rfc/rfc1950 -
[RFC1951] -
P. Deutsch. DEFLATE Compressed Data Format Specification version 1.3. May 1996. Informational. URL: https://www.rfc-editor.org/rfc/rfc1951 -
[RFC1952] -
P. Deutsch. GZIP file format specification version 4.3. May 1996. Informational. URL: https://www.rfc-editor.org/rfc/rfc1952 -
[RFC2119] -
S. Bradner. Key words for use in RFCs to Indicate Requirement Levels. March 1997. Best Current Practice. URL: https://datatracker.ietf.org/doc/html/rfc2119 -
[WebIDL] -
Edgar Chen; Timothy Gu. Web IDL Standard. Living Standard. URL: https://webidl.spec.whatwg.org/ -
[WHATWG-STREAMS] -
Adam Rice; et al. Streams Standard. Living Standard. URL: https://streams.spec.whatwg.org/ -
-

Informative References

-
-
[RFC7230] -
R. Fielding, Ed.; J. Reschke, Ed.. Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing. June 2014. Proposed Standard. URL: https://httpwg.org/specs/rfc7230.html -
-

IDL Index

-
enum CompressionFormat {
-  "deflate",
-  "deflate-raw",
-  "gzip",
-};
-
-[Exposed=*]
-interface CompressionStream {
-  constructor(CompressionFormat format);
-};
-CompressionStream includes GenericTransformStream;
-
-[Exposed=*]
-interface DecompressionStream {
-  constructor(CompressionFormat format);
-};
-DecompressionStream includes GenericTransformStream;
-
-
- - - - - - - - - - - - - - - - - -
- MDN -
-

CompressionStream/CompressionStream

-

In only one current engine.

-
- FirefoxNoneSafariNoneChrome80+ -
- Opera?Edge80+ -
- Edge (Legacy)?IENone -
- Firefox for Android?iOS Safari?Chrome for Android?Android WebView?Samsung Internet?Opera Mobile? -
- Node.js17.0.0+ -
-
-
-
- MDN -
-

CompressionStream

-

In only one current engine.

-
- FirefoxNoneSafariNoneChrome80+ -
- Opera?Edge80+ -
- Edge (Legacy)?IENone -
- Firefox for Android?iOS Safari?Chrome for Android?Android WebView?Samsung Internet?Opera Mobile? -
- Node.js18.0.0+ -
-
-
-
- MDN -
-

DecompressionStream/DecompressionStream

-

In only one current engine.

-
- FirefoxNoneSafariNoneChrome80+ -
- Opera?Edge80+ -
- Edge (Legacy)?IENone -
- Firefox for Android?iOS Safari?Chrome for Android?Android WebView?Samsung Internet?Opera Mobile? -
- Node.js17.0.0+ -
-
-
-
- MDN -
-

DecompressionStream

-

In only one current engine.

-
- FirefoxNoneSafariNoneChrome80+ -
- Opera?Edge80+ -
- Edge (Legacy)?IENone -
- Firefox for Android?iOS Safari?Chrome for Android?Android WebView?Samsung Internet?Opera Mobile? -
- Node.js18.0.0+ -
-
-
- - \ No newline at end of file diff --git a/w3c.json b/w3c.json deleted file mode 100644 index ddb742b..0000000 --- a/w3c.json +++ /dev/null @@ -1,5 +0,0 @@ - { - "group": [80485] -, "contacts": ["yoavweiss"] -, "repo-type": "cg-report" -}