forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 632781 - Scroll non-accelerated canvases correctly with the conte…
…nt; r=matt,joe,roc a=blocking-betaN
- Loading branch information
Showing
5 changed files
with
71 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
<!-- | ||
This test makes sure that scrolling a normal sized canvas would correctly | ||
scroll its contents. Normal sized canvases are accelerated, so this test | ||
makes sure that the accelerated code path for this operaton works correctly. | ||
The padding in this test is added mostly to make sure that scrollLeft/Top | ||
correctly skip the padding. | ||
--> | ||
<div id="container" style="width: 100px; height: 100px; padding: 10px; overflow: hidden"> | ||
<canvas width="300" height="300" id="c"></canvas> | ||
</div> | ||
<script> | ||
var ctx = document.getElementById("c").getContext("2d"); | ||
ctx.fillStyle = "red"; | ||
ctx.fillRect(0, 0, 300, 100); | ||
ctx.fillStyle = "green"; | ||
ctx.fillRect(0, 100, 300, 200); | ||
var container = document.getElementById("container"); | ||
container.scrollLeft = 10; | ||
container.scrollTop = 110; | ||
</script> | ||
</body> | ||
</html> |
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,13 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
<div style="width: 120px; height: 120px; overflow: hidden"> | ||
<canvas width="120" height="120" id="c"></canvas> | ||
</div> | ||
<script> | ||
var ctx = document.getElementById("c").getContext("2d"); | ||
ctx.fillStyle = "green"; | ||
ctx.fillRect(0, 0, 120, 120); | ||
</script> | ||
</body> | ||
</html> |
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,27 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
<!-- | ||
This test makes sure that scrolling a huge canvas would correctly scroll | ||
its contents. We don't accelerate extremely large canvases because of | ||
GPU maximum texture size limits, so this test makes sure that the | ||
non-accelerated code path for this operation works correctly. | ||
The padding in this test is added mostly to make sure that scrollLeft/Top | ||
correctly skip the padding. | ||
--> | ||
<div id="container" style="width: 100px; height: 100px; padding: 10px; overflow: hidden"> | ||
<canvas width="10000" height="10000" id="c"></canvas> | ||
</div> | ||
<script> | ||
var ctx = document.getElementById("c").getContext("2d"); | ||
ctx.fillStyle = "red"; | ||
ctx.fillRect(0, 0, 10000, 5000); | ||
ctx.fillStyle = "green"; | ||
ctx.fillRect(0, 5000, 10000, 5000); | ||
var container = document.getElementById("container"); | ||
container.scrollLeft = 10; | ||
container.scrollTop = 5010; | ||
</script> | ||
</body> | ||
</html> |
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