Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split api.Headers.lexicographical_sorting in two and update the data #22809

Merged
merged 1 commit into from
Apr 9, 2024

Conversation

ddbeck
Copy link
Collaborator

@ddbeck ddbeck commented Apr 9, 2024

Summary

Split two wrongly combined features for iterating over Headers objects and update their support data.

Test results and supporting details

Manually tested with something close to this (extraneous logging and such removed):

var populate = [];
var abc = ["A", "B", "C", "D", "E", "F"].reverse();
for (var index = 0; index < 512; index++) {
  populate[index] = ["X-" + abc[index % abc.length], "_"];
}

var headers = new Headers([
  ["Accept-Language", "en-US,en;q=0.5"],
  ["Accept-Language", "en-US,en;q=0.5"],
  ["Accept-Language", "en-US,en;q=0.5"],
].concat(populate));
console.log(headers);
for (var header of headers) {
  console.log(header);
}

I was investigating this feature in the course of creating a fetch feature in web-features. The data for Safari looked dubious. I soon found out that the two parts of this (sorting and combining) have different histories. Instead of using partial implementations, I split the feature in two.

The highlights here:

  • Safari always supported both (from 10.1)
  • Edge acquired them separately (in 16 and 18)
  • Firefox got both at the same time, but later than reported (57, not 44)

I was investingating this feature in the course of creating a fetch feature in web-features. The data for Safari looked dubious. I soon found out that the two parts of this (sorting and combining) have different histories. Instead of using partial implementations, I split the feature in two.

The highlights here:

- Safari always supported both
- Edge acquired them separately
- Firefox got both at the same time, but later than reported
@github-actions github-actions bot added the data:api 🐇 Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API label Apr 9, 2024
Copy link
Collaborator

@foolip foolip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are some very specific subfeatures, but if we should have them at all I think it's best to split them if they weren't implemented together.

@foolip foolip merged commit 549c996 into mdn:main Apr 9, 2024
5 checks passed
@ddbeck ddbeck deleted the headers-lexico branch April 9, 2024 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:api 🐇 Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants