mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 17:31:47 +09:00
Issue #2713 - Check for NaN before std::min/max() in DOMQuad and DOMRect.
If there is a NaN involved we should not return 0 here.
This commit is contained in:
parent
8f2f4d8d3d
commit
f1c456c625
3 changed files with 35 additions and 10 deletions
|
|
@ -8,7 +8,7 @@
|
|||
#include "mozilla/dom/DOMQuadBinding.h"
|
||||
#include "mozilla/dom/DOMPoint.h"
|
||||
#include "mozilla/dom/DOMRect.h"
|
||||
#include <algorithm>
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
|
|
@ -106,8 +106,8 @@ DOMQuad::GetHorizontalMinMax(double* aX1, double* aX2) const
|
|||
x1 = x2 = Point(0)->X();
|
||||
for (uint32_t i = 1; i < 4; ++i) {
|
||||
double x = Point(i)->X();
|
||||
x1 = std::min(x1, x);
|
||||
x2 = std::max(x2, x);
|
||||
x1 = NaNSafeMin(x1, x);
|
||||
x2 = NaNSafeMax(x2, x);
|
||||
}
|
||||
*aX1 = x1;
|
||||
*aX2 = x2;
|
||||
|
|
@ -120,8 +120,8 @@ DOMQuad::GetVerticalMinMax(double* aY1, double* aY2) const
|
|||
y1 = y2 = Point(0)->Y();
|
||||
for (uint32_t i = 1; i < 4; ++i) {
|
||||
double y = Point(i)->Y();
|
||||
y1 = std::min(y1, y);
|
||||
y2 = std::max(y2, y);
|
||||
y1 = NaNSafeMin(y1, y);
|
||||
y2 = NaNSafeMax(y2, y);
|
||||
}
|
||||
*aY1 = y1;
|
||||
*aY2 = y2;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue