aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2019-10-28 19:53:49 -0400
committerGitHub <noreply@github.com>2019-10-28 19:53:49 -0400
commit1b77e42d79dbd250012045d2c0cc606530f35ff1 (patch)
tree1aab662624d12402debf2712f113e12ca7e9c771
parent6f4c6712cba4b6a72f93d6ed776263a0243a3196 (diff)
parent35a48a7577794c2929dbe8d912f8993da5c6b508 (diff)
downloadservo-1b77e42d79dbd250012045d2c0cc606530f35ff1.tar.gz
servo-1b77e42d79dbd250012045d2c0cc606530f35ff1.zip
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
-rw-r--r--components/script/canvas_state.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/components/script/canvas_state.rs b/components/script/canvas_state.rs
index 5dd32c61c0b..90630fb07c3 100644
--- a/components/script/canvas_state.rs
+++ b/components/script/canvas_state.rs
@@ -1241,6 +1241,10 @@ impl CanvasState {
y: f64,
fill_rule: CanvasFillRule,
) -> bool {
+ if !(x.is_finite() && y.is_finite()) {
+ return false;
+ }
+
let fill_rule = match fill_rule {
CanvasFillRule::Nonzero => FillRule::Nonzero,
CanvasFillRule::Evenodd => FillRule::Evenodd,