From 9cc68e0b80175263196b4db2096cc259f0db7d7b Mon Sep 17 00:00:00 2001 From: Guohui Deng Date: Thu, 12 Dec 2024 16:12:48 -0700 Subject: [PATCH 1/9] Add contentEncoding to resource timing interface. --- index.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/index.html b/index.html index 89e683c..b9fb2f3 100644 --- a/index.html +++ b/index.html @@ -376,6 +376,7 @@

readonly attribute unsigned short responseStatus; readonly attribute RenderBlockingStatusType renderBlockingStatus; readonly attribute DOMString contentType; + readonly attribute DOMString contentEncoding; [Default] object toJSON(); }; @@ -715,6 +716,11 @@

resource info's [=response body info/content type=].

+

+ The contentEncoding getter steps are to return this's + resource info's + [=response body info/content encoding=]. +

The renderBlockingStatus getter steps are to return blocking if From 30457956d9674017e578c7edffc7e0d729c6ca1a Mon Sep 17 00:00:00 2001 From: Guohui Deng Date: Fri, 13 Dec 2024 15:35:14 -0700 Subject: [PATCH 2/9] contentEncoding must be filtered before being reported. --- index.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index b9fb2f3..fcaa861 100644 --- a/index.html +++ b/index.html @@ -717,9 +717,11 @@

[=response body info/content type=].

- The contentEncoding getter steps are to return this's - resource info's - [=response body info/content encoding=]. + The contentEncoding getter steps are to return a filtered + value of this's + resource info's [=response body info/content encoding=]. If the + value is not an empty string and it's not an encoding the browser + natively supports, return `unknown` instead.

The renderBlockingStatus getter steps are to return From 0f148bf3655a412d028ffadac57b27dc47693c45 Mon Sep 17 00:00:00 2001 From: Guohui Deng Date: Mon, 16 Dec 2024 13:52:58 -0700 Subject: [PATCH 3/9] improve text. --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index fcaa861..cde43a9 100644 --- a/index.html +++ b/index.html @@ -720,8 +720,8 @@

The contentEncoding getter steps are to return a filtered value of this's resource info's [=response body info/content encoding=]. If the - value is not an empty string and it's not an encoding the browser - natively supports, return `unknown` instead. + value is not an empty string and it's not an encoding value the + browser natively supports, return `unknown` instead.

The renderBlockingStatus getter steps are to return From 6437898835b24e632b214f08e5821d73944ce489 Mon Sep 17 00:00:00 2001 From: Guohui Deng Date: Thu, 30 Jan 2025 15:30:29 -0700 Subject: [PATCH 4/9] Add updated details on how contentEncoding should be filtered. --- index.html | 54 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 49 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index cde43a9..354e3d0 100644 --- a/index.html +++ b/index.html @@ -717,12 +717,56 @@

[=response body info/content type=].

- The contentEncoding getter steps are to return a filtered - value of this's - resource info's [=response body info/content encoding=]. If the - value is not an empty string and it's not an encoding value the - browser natively supports, return `unknown` instead. + The contentEncoding getter steps are to perform the following + steps:

+
    +
  1. +

    + Let codings be this's response body info's [=response + body info/content encoding=]. +

    +

    + codings is a list of strings. +

    +
  2. +
  3. +

    + If codings is null, return the empty string. +

    +
  4. +
  5. +

    + If codings contains two strings or more, return + "multiple". +

    +
  6. +
  7. +

    + codings must contain exactly one string. +

    +

    + Let coding be the string in codings. +

    + If coding is recognized and supported by browser, return + coding. +

    +

    + A browser should only recognize the empty string or coding values registered + + here. "identify" should not be recognized as it + is reserved(as detailed + + here). Not all recognized values are supported by the browser. +

    +
  8. +
  9. +

    + Otherwise, return "unknown". +

    +
  10. +

The renderBlockingStatus getter steps are to return blocking if From 4a4510d8ba8ce16b5d42283ceae7a0a026506803 Mon Sep 17 00:00:00 2001 From: Guohui Deng Date: Thu, 13 Feb 2025 15:52:02 -0700 Subject: [PATCH 5/9] Fix and improve contentEncoding steps. Also applied an improvement at "transferSize". --- index.html | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/index.html b/index.html index 354e3d0..b97b045 100644 --- a/index.html +++ b/index.html @@ -668,8 +668,7 @@

info's [=response body info/decoded size=].

- The transferSize getter steps are to perform the following - steps: + The transferSize getter steps are the following:

  1. @@ -717,8 +716,7 @@

    [=response body info/content type=].

    - The contentEncoding getter steps are to perform the following - steps: + The contentEncoding getter steps are the following:

    1. @@ -727,9 +725,6 @@

      "PerformanceResourceTiming">response body info's [=response body info/content encoding=].

      -

      - codings is a list of strings. -

    2. @@ -744,21 +739,12 @@

    3. - codings must contain exactly one string. -

      -

      - Let coding be the string in codings. -

      - If coding is recognized and supported by browser, return - coding. -

      -

      - A browser should only recognize the empty string or coding values registered + If codings[0] is supported by the user agent, and is listed in the - here. "identify" should not be recognized as it - is reserved(as detailed + content encoding registry on IANA, return codings[0]. + Note "identity" is never supported as a coding. See details - here). Not all recognized values are supported by the browser. + here.

    4. From 693b19e0f627cc99288c4504ff89e3c7e4de2ac4 Mon Sep 17 00:00:00 2001 From: Guohui Deng Date: Thu, 13 Feb 2025 16:30:35 -0700 Subject: [PATCH 6/9] Move the "note" to informative note. --- index.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index b97b045..859ef75 100644 --- a/index.html +++ b/index.html @@ -742,7 +742,9 @@

      If codings[0] is supported by the user agent, and is listed in the content encoding registry on IANA, return codings[0]. - Note "identity" is never supported as a coding. See details +

      +

      + "identity" is never supported as a coding. See details here.

      From 6b50e384cc228f7d4480bf256ca5e9a723689c8e Mon Sep 17 00:00:00 2001 From: Guohui Deng Date: Thu, 13 Feb 2025 18:05:46 -0700 Subject: [PATCH 7/9] if codings[0] is empty string It should be returned. --- index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 859ef75..1c7b426 100644 --- a/index.html +++ b/index.html @@ -739,7 +739,8 @@

    5. - If codings[0] is supported by the user agent, and is listed in the + If codings[0] is the empty string, or it is supported by the user agent, + and is listed in the content encoding registry on IANA, return codings[0].

      From d75d04080f75d606d5620e60dc150ff124f7f6af Mon Sep 17 00:00:00 2001 From: Guohui Deng Date: Wed, 28 May 2025 14:23:09 -0600 Subject: [PATCH 8/9] Update this PR accoridng to the latest fetch spec. --- index.html | 42 +++--------------------------------------- 1 file changed, 3 insertions(+), 39 deletions(-) diff --git a/index.html b/index.html index 1c7b426..6565d5d 100644 --- a/index.html +++ b/index.html @@ -716,46 +716,10 @@

      [=response body info/content type=].

      - The contentEncoding getter steps are the following: + The contentEncoding getter steps are to return + this's resource info + 's [=response body info/content encoding=].

      -
        -
      1. -

        - Let codings be this's response body info's [=response - body info/content encoding=]. -

        -
      2. -
      3. -

        - If codings is null, return the empty string. -

        -
      4. -
      5. -

        - If codings contains two strings or more, return - "multiple". -

        -
      6. -
      7. -

        - If codings[0] is the empty string, or it is supported by the user agent, - and is listed in the - - content encoding registry on IANA, return codings[0]. -

        -

        - "identity" is never supported as a coding. See details - - here. -

        -
      8. -
      9. -

        - Otherwise, return "unknown". -

        -
      10. -

      The renderBlockingStatus getter steps are to return blocking if From 03df97e3714fbaaba416fd56dc7666e962e82647 Mon Sep 17 00:00:00 2001 From: Guohui Deng Date: Thu, 29 May 2025 10:33:16 -0600 Subject: [PATCH 9/9] Remove some superfluous words Co-authored-by: Anne van Kesteren --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 6565d5d..20d1f65 100644 --- a/index.html +++ b/index.html @@ -668,7 +668,7 @@

      info's [=response body info/decoded size=].

      - The transferSize getter steps are the following: + The transferSize getter steps are: