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

Preserve ranges in mirroring #23856

Closed
wants to merge 1 commit into from
Closed

Preserve ranges in mirroring #23856

wants to merge 1 commit into from

Conversation

foolip
Copy link
Contributor

@foolip foolip commented Jul 19, 2024

Fixes #23855.

@github-actions github-actions bot added infra Infrastructure issues (npm, GitHub Actions, releases) of this project scripts Issues or pull requests regarding the scripts in scripts/. labels Jul 19, 2024
@foolip foolip requested a review from queengooborg July 19, 2024 10:31
}
if (sourceVersion.replace('≤', '') in browserData.releases) {
return sourceVersion;
}
throw new Error(`Cannot find iOS version matching Safari ${sourceVersion}`);
}

const releaseKeys = Object.keys(browserData.releases);
releaseKeys.sort(compareVersions);
const versions = Object.keys(browserData.releases);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed this so that the local variable would be v both for Safari above and everything else below. Makes it easier to see that the condition around first release is the same.

sourceRelease.engine_version &&
compare(release.engine_version, sourceRelease.engine_version, '>=')
) {
return r;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the key line. Previously ranges were never propagated here, and now they are except for the first release.

};

const mirrored = mirrorSupport('edge', support);
// Uncertain early Chrome support doesn't imply possible EdgeHTML
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was a bit concerned about introducing ranges where there might not be any uncertainty, so I looked at what would be different if Edge 79 doesn't get ranges. Happily, only these 22 paths are affected:

css.properties.filter.svg_elements
html.elements.iframe.sandbox.allow-forms
html.elements.iframe.sandbox.allow-pointer-lock
html.elements.iframe.sandbox.allow-same-origin
html.elements.iframe.sandbox.allow-scripts
html.elements.iframe.sandbox.allow-top-navigation
http.data-url.html_files
http.headers.Content-Security-Policy.form-action.blocks_redirects
http.mixed-content
http.mixed-content.allow_file_urls
http.mixed-content.allow_localhost_url
http.mixed-content.allow_loopback_url
svg.global_attributes.fill-rule
svg.global_attributes.filter
webextensions.api.permissions.Permissions
webextensions.api.permissions
webextensions.api.permissions.contains
webextensions.api.permissions.getAll
webextensions.api.permissions.onAdded
webextensions.api.permissions.onRemoved
webextensions.api.permissions.remove
webextensions.api.permissions.request

Fixing the data in these cases is probably better than adding a rule about transitions from non-WebKit to Blink engines.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some ranges removed in #23858.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Another in #23861.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

#23865 fixes filter for SVG elements. That leaves only the HTTP, SVG and WebExtensions data.

@foolip
Copy link
Contributor Author

foolip commented Jul 19, 2024

Tests are failing because this changes when mirroring can be used. Let's make sure we like the new behavior before I update the data to pass the tests.

Copy link
Member

@Elchi3 Elchi3 left a comment

Choose a reason for hiding this comment

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

LGTM overall. Thanks for fixing this! Nit to test Firefox Android with more interesting ranges.

The proposed fixes from CI make sense to me. Many can be fixed with npm run fix and for the consistency errors, we should remove the ranges from the upstream browser:

  • api.RTCStatsReport.type_inbound-rtp.*: chrome should be 79
  • css.properties.line-break.*: firefox should be 69

it('firefox_android', () => {
const support: InternalSupportBlock = {
firefox: {
version_added: '≤100',
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
version_added: '≤100',
version_added: '≤79',

};

const mirrored = mirrorSupport('firefox_android', support);
assert.deepEqual(mirrored, { version_added: '≤100' });
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
assert.deepEqual(mirrored, { version_added: '≤100' });
assert.deepEqual(mirrored, { version_added: '≤79' });

const mirrored = mirrorSupport('firefox_android', support);
assert.deepEqual(mirrored, { version_added: '≤100' });
});

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
it('firefox_android', () => {
const support: InternalSupportBlock = {
firefox: {
version_added: '≤69',
},
};
const mirrored = mirrorSupport('firefox_android', support);
assert.deepEqual(mirrored, { version_added: '≤79' });
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infra Infrastructure issues (npm, GitHub Actions, releases) of this project scripts Issues or pull requests regarding the scripts in scripts/.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mirroring ranged versions removes ranges for most browsers
2 participants