-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Clean up HTMLImageElement::handle_event #17632
Conversation
Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @jdm (or someone else) soon. |
let shape = element.get_shape_from_coords(); | ||
let shp = match shape { | ||
Some(x) => x.absolute_coords(bcr_p), | ||
None => return, |
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.
nit: no need to align the => on both lines; the preferred style is None => return,
for all of the similar lines.
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.
Will make the change now
Also, it appears that
|
Yea, |
No, you can update the tests to accommodate it instead. |
Hopefully that should do it. Thanks for the help @jdm ! |
This looks good! Could you squash the commits into one before we merge this? |
Clean up HTMLImageElement::handle_event Area::hit_test now uses a reference instead of taking ownership Fix trailing whitespace Unalign => in match Fix Area::hit_test tests to reflect updated function signature
Done! |
@bors-servo: r+ |
📌 Commit 420a787 has been approved by |
Clean up HTMLImageElement::handle_event Reflects desired changes in #15832 <!-- Please describe your changes on the following line: --> Cleans up `HTMLImageElement::handle_event` located in `components/script/dom/htmlimageelement.rs` --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #15832 - [X] These changes do not require tests because this change maintains the same logic <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17632) <!-- Reviewable:end -->
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev |
Reflects desired changes in #15832
Cleans up
HTMLImageElement::handle_event
located incomponents/script/dom/htmlimageelement.rs
./mach build -d
does not report any errors./mach test-tidy
does not report any errorsThese changes fix Clean up un-idiomatic code in HTMLImageElement::handle_event #15832
These changes do not require tests because this change maintains the same logic
This change is