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

test: prevent setting read-only properties on DOMRect #3858

Merged
merged 1 commit into from
Jan 18, 2023
Merged

Conversation

straker
Copy link
Contributor

@straker straker commented Jan 16, 2023

Overriding the prototype for DOMRectReadOnly to throw errors on setting left, right, top, and bottom properties to match what happens in an extension context.

const test = $0.getBoundingClientRect();
test.right = 1;  // Uncaught TypeError: setting getter-only property "right"

This should fail tests any time we do this now. If I try to set the right property in get-background-color, multiple tests fail:

screenshot of test output showing 3 failing tests caused by 'TypeError: setting getter-only property right'

Closes: #3837

@straker straker requested a review from a team as a code owner January 16, 2023 23:43
@straker straker merged commit 45a08b6 into develop Jan 18, 2023
@straker straker deleted the readonlyrect branch January 18, 2023 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Color contrast checks result in an error when axe-core is run from an extension
2 participants