Auto merge of #24573 - teapotd:is-point-in-path-nan, r=jdm

Return false from CanvasState::is_point_in_path for NaN/infinite values

Servo doesn't pass WPT test `/2dcontext/path-objects/2d.path.isPointInPath.nonfinite.html` when built with raqote (see [here](https://github.com/servo/servo/pull/24470#issuecomment-546009000)).
This change adds a missing check for NaN/infinite values in `CanvasState::is_point_in_path` and fixes this.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #24540
- [X] These changes do not require tests because WPT tests cover it
This commit is contained in:
bors-servo 2019-10-28 19:53:49 -04:00 committed by GitHub
commit 1b77e42d79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1241,6 +1241,10 @@ impl CanvasState {
y: f64, y: f64,
fill_rule: CanvasFillRule, fill_rule: CanvasFillRule,
) -> bool { ) -> bool {
if !(x.is_finite() && y.is_finite()) {
return false;
}
let fill_rule = match fill_rule { let fill_rule = match fill_rule {
CanvasFillRule::Nonzero => FillRule::Nonzero, CanvasFillRule::Nonzero => FillRule::Nonzero,
CanvasFillRule::Evenodd => FillRule::Evenodd, CanvasFillRule::Evenodd => FillRule::Evenodd,