forked from Floorp-Projects/Floorp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1831148: Increase clamping range for
TransformGfxRectToAncestor
…
…. r=emilio The clamping is overaly pessimistic because the returned `Rect` is still float-based, and the call site does its own clamping to `nscoord`. Clamping to float's numeric limit causes significant floating point errors when clipping the transformed rect, resulting in incorrect transforms. Differential Revision: https://phabricator.services.mozilla.com/D178081
- Loading branch information
Showing
3 changed files
with
53 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<script src="/tests/SimpleTest/SimpleTest.js"></script> | ||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> | ||
<style> | ||
#marker { | ||
width: 1px; | ||
height: 1px; | ||
} | ||
#outer { | ||
height: 1000px; | ||
background: #a0ffff; | ||
overflow: scroll; | ||
} | ||
|
||
#inner { | ||
height: 16593200px; | ||
background: #ffa0a0; | ||
} | ||
|
||
.log { | ||
white-space: pre; | ||
} | ||
</style> | ||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1831148">Mozilla Bug 1831148</a> | ||
<div id="marker"></div> | ||
<div id="outer"> | ||
<div id="inner"></div> | ||
</div> | ||
<script> | ||
SimpleTest.waitForExplicitFinish(); | ||
addLoadEvent(() => { | ||
const interval = 20; | ||
const increment = outer.scrollHeight / interval; | ||
const offset = marker.getBoundingClientRect().bottom; | ||
for (let i = 0; i < interval; i++) { | ||
outer.scrollTop = i * increment; | ||
console.log(outer.scrollTop); | ||
// Shift to account for viewport coordinate shift. | ||
const bcrTop = -inner.getBoundingClientRect().top + offset; | ||
// Floating point value diverges from scrollTop. | ||
isfuzzy(bcrTop, outer.scrollTop, 1, "scrollTop and BCR top match"); | ||
} | ||
SimpleTest.finish(); | ||
}); | ||
</script> |