Closed Bug 1627285 Opened 5 years ago Closed 5 years ago

DOMQuad and DOMRect should not use std::min/max for NaN-able doubles

Categories

(Core :: DOM: CSS Object Model, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: TimothyGu, Assigned: TimothyGu)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.83 Safari/537.36

Steps to reproduce:

console.log(new DOMRect(0, 0, NaN, NaN).top);
console.log(new DOMRect(0, 0, NaN, NaN).left);
console.log(new DOMQuad({x: 0}, {x: 0}, {x: NaN}, {x: 0}).getBounds().x)

Actual results:

All three return 0.

Expected results:

After https://github.com/w3c/fxtf-drafts/pull/395, all three should return NaN. WPTs:

I could help fix this bug in

Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3

Oops, pressed send too early. I'm creating a patch for this.

Tests will be added as a part of bug 1626471. I have manually confirmed that
the added tests pass after this commit.

Assignee: nobody → timothygu99
Status: NEW → ASSIGNED
Attachment #9138115 - Attachment description: Bug 1627285 - Check for NaN before std::min/max() in DOMQuad and DOMRect. r=emilio → Bug 1627285 - Check for NaN before std::min/max() in DOMQuad and DOMRect. r=emilio,jwalden
Pushed by rmaries@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/791ce1643ae0 Check for NaN before std::min/max() in DOMQuad and DOMRect. r=emilio,jwalden
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: