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

Add back ClientRect alias for DOMRectReadOnly #11960

Merged
merged 1 commit into from
Aug 18, 2021

Conversation

foolip
Copy link
Contributor

@foolip foolip commented Aug 10, 2021

Since the properties top, right, bottom and left are on DOMRectReadOnly,
it's necessary to treat ClientRect as an alias of both DOMRect and
DOMRectReadOnly. See discussion starting here:
#11679 (comment)

This reverts #11694 but
goes much further in representing the ClientRect support than before.

Since the properties top, right, bottom and left are on DOMRectReadOnly,
it's necessary to treat ClientRect as an alias of both DOMRect and
DOMRectReadOnly. See discussion starting here:
mdn#11679 (comment)

This reverts mdn#11694 but
goes much further in representing the ClientRect support than before.
@foolip foolip requested a review from ddbeck August 10, 2021 07:00
@github-actions github-actions bot added the data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API label Aug 10, 2021
"version_added": "31"
},
{
"alternative_name": "DOMRect",
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 had to add this to not have a hole in the support for Firefox. It looks like Firefox first just renamed ClientRect to DOMRect and then split it into DOMRect and DOMRectReadOnly with all the extra bits. It's a bit weird to say that DOMRect was an alias of DOMRectReadOnly, but only because of their current relationship. The DOMRect in Firefox 27-30 was just like ClientRect in 3-26 AFAICT.

I'm not sure if some note would help explain this?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, I'm not sure there's a note to be written that doesn't exaggerate what the looks-weird-now-but-made-sense-then quality of the data. Let's leave this as-is. 👍

Copy link
Collaborator

@ddbeck ddbeck left a comment

Choose a reason for hiding this comment

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

Thanks, @foolip! I'm happy with this approach. 🎉

"version_added": "31"
},
{
"alternative_name": "DOMRect",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, I'm not sure there's a note to be written that doesn't exaggerate what the looks-weird-now-but-made-sense-then quality of the data. Let's leave this as-is. 👍

@ddbeck ddbeck merged commit ffe6c51 into mdn:main Aug 18, 2021
@foolip foolip deleted the DOMRectReadOnly-alias-ClientRect branch August 18, 2021 13:19
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.

3 participants