-
Notifications
You must be signed in to change notification settings - Fork 109
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
Implement full support for intersectionRect/boundingClientRect, fix viewportRect typing, and harden JSON schema #1411
Conversation
…iewportRect typing, and harden JSON schema * Add remaining properties of DOMRect to the JSON Schema. * Fix type of viewport rect which has integer width/height versus DOMRect which has floats. * Ensure all properties are required and additionalProperties are false.
2764ea8
to
276dfa9
Compare
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
276dfa9
to
ddc0bc1
Compare
), | ||
'height' => array( | ||
'type' => 'number', | ||
'minimum' => 0, | ||
'type' => 'number', // An 'unrestricted double'. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this comment "an unrestricted double" and below L109 etc its "A double"? Are they different?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this is what it is referred to in the DOM spec: https://drafts.fxtf.org/geometry/#dom-domrectreadonly-width
This is probably too much information 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in 7399131
'intersectionRect' => array( | ||
'width' => 640, | ||
'height' => 480, | ||
'wooHoo' => 'bad', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:)
Overall looks good and all tests pass! I left one question. |
Co-authored-by: Adam Silverstein <adamjs@google.com>
@@ -3,6 +3,8 @@ | |||
* Tests for auto-sizes plugin's optimization-detective.php. | |||
* | |||
* @package auto-sizes | |||
* | |||
* @noinspection PhpUnhandledExceptionInspection |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a PHPStorm thing, right? Do we usually have IDE-specific annotations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, elsewhere in the codebase I've been using them.
intersectionRect
/clientBoundingRect
to the JSON Schema.required
and thatadditionalProperties
are not allowed.get_sample_url_metric()
method in the shared helper trait rather than duplicate the logic across various test classes. This is a follow-up to Move Optimization Detective test cases into separate files and add helper trait to reduce code duplication #1405 which refactored the tests for Optimization Detective.@throws
tag usages, removing where obsolete and suppressing with@noinspection
where irrelevant.OD_HTML_Tag_Processor::warn()
method.Tip
Suppress whitespace when reviewing the changes in this pull request!