Backed out changeset 75588bc18622 (bug 1914831) as requested by Emilio for causing unforeseen failures. CLOSED TREE
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user