Skip to content

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

Merged
straker merged 1 commit intodevelopfrom
readonlyrect
Jan 18, 2023
Merged

test: prevent setting read-only properties on DOMRect#3858
straker merged 1 commit intodevelopfrom
readonlyrect

Conversation

@straker
Copy link
Copy Markdown
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