Backed out changeset 75588bc18622 (bug 1914831) as requested by Emilio for causing unforeseen failures. CLOSED TREE

This commit is contained in:
Tamas Szentpeteri
2024-08-26 18:49:59 +03:00
parent cf6400cc15
commit be5d9c8333
2 changed files with 9 additions and 22 deletions

View File

@@ -148,19 +148,13 @@ JSObject* DOMRectList::WrapObject(JSContext* cx,
static double RoundFloat(double aValue) { return floor(aValue + 0.5); }
void DOMRect::SetLayoutRect(const nsRect& aLayoutRect) {
if (StaticPrefs::dom_rect_legacy_rounding()) {
double scale = 65536.0;
// Round to the nearest 1/scale units. We choose scale so it can be
// represented exactly by machine floating point.
double scaleInv = 1 / scale;
double t2pScaled = scale / AppUnitsPerCSSPixel();
double x = RoundFloat(aLayoutRect.x * t2pScaled) * scaleInv;
double y = RoundFloat(aLayoutRect.y * t2pScaled) * scaleInv;
return SetRect(
float(x), float(y),
float(RoundFloat(aLayoutRect.XMost() * t2pScaled) * scaleInv - x),
float(RoundFloat(aLayoutRect.YMost() * t2pScaled) * scaleInv - y));
}
auto rect = CSSRect::FromAppUnits(aLayoutRect);
SetRect(rect.x, rect.y, rect.width, rect.height);
double scale = 65536.0;
// Round to the nearest 1/scale units. We choose scale so it can be
// represented exactly by machine floating point.
double scaleInv = 1 / scale;
double t2pScaled = scale / AppUnitsPerCSSPixel();
double x = RoundFloat(aLayoutRect.x * t2pScaled) * scaleInv;
double y = RoundFloat(aLayoutRect.y * t2pScaled) * scaleInv;
SetRect(x, y, RoundFloat(aLayoutRect.XMost() * t2pScaled) * scaleInv - x,
RoundFloat(aLayoutRect.YMost() * t2pScaled) * scaleInv - y);
}

View File

@@ -2391,13 +2391,6 @@
value: false
mirror: always
# Whether the algorithm we use for DOMRect::SetLayoutRect is the legacy one,
# which is different from what the rest of Gecko uses.
- name: dom.rect.legacy-rounding
type: bool
value: false
mirror: always
- name: dom.require_user_interaction_for_beforeunload
type: bool
value: true