Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
2012-03-01 Florin Malita <fmalita@google.com>
        Percent width/height SVG not always scaled on window resize
        https://bugs.webkit.org/show_bug.cgi?id=79490

        Reviewed by Nikolas Zimmermann.

        Update tests to avoid the use of window.resize{To,By}.

        * fast/repaint/percent-minheight-resize-expected.html:
        * fast/repaint/percent-minheight-resize.html:
        * svg/custom/svg-percent-scale-expected.html:
        * svg/custom/svg-percent-scale-vonly-expected.html:
        * svg/custom/svg-percent-scale-vonly.html:
        * svg/custom/svg-percent-scale.html:

Canonical link: https://commits.webkit.org/97085@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@109334 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Nikolas Zimmermann committed Mar 1, 2012
1 parent c5ed8dd commit 1407b2f
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 75 deletions.
16 changes: 16 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,19 @@
2012-03-01 Florin Malita <fmalita@google.com>

Percent width/height SVG not always scaled on window resize
https://bugs.webkit.org/show_bug.cgi?id=79490

Reviewed by Nikolas Zimmermann.

Update tests to avoid the use of window.resize{To,By}.

* fast/repaint/percent-minheight-resize-expected.html:
* fast/repaint/percent-minheight-resize.html:
* svg/custom/svg-percent-scale-expected.html:
* svg/custom/svg-percent-scale-vonly-expected.html:
* svg/custom/svg-percent-scale-vonly.html:
* svg/custom/svg-percent-scale.html:

2012-02-29 Pavel Podivilov <podivilov@chromium.org>

Web Inspector: abstract out the common pattern of creating auto-updated locations.
Expand Down
16 changes: 9 additions & 7 deletions LayoutTests/fast/repaint/percent-minheight-resize-expected.html
@@ -1,16 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<script src="resources/repaint.js"></script>
<script src="resources/repaint.js"></script>
<script>
function repaintTest()
{
document.getElementById('resize-target').style.height = '200px';
}
</script>
</head>

<body style="margin: 0; padding: 0; overflow: hidden;" onload="runRepaintTest()">
<div style="width: 100px; height: 100px; background-color: green; position: absolute;"></div>
<div id="resize-target" style="width: 400px; height: 400px; position: absolute;"></div>

<script>
function repaintTest() {
window.resizeBy(0, -window.innerHeight / 2);
}
</script>
<div style="width: 100px; height: 100px; background-color: green; position: absolute;"></div>
</body>
</html>
25 changes: 13 additions & 12 deletions LayoutTests/fast/repaint/percent-minheight-resize.html
@@ -1,21 +1,22 @@
<!DOCTYPE html>
<html>
<head>
<script src="resources/repaint.js"></script>
<title>Test for http://bugs.webkit.org/show_bug.cgi?id=79490</title>
<script src="resources/repaint.js"></script>
<script>
function repaintTest()
{
document.getElementById('resize-target').style.height = '200px';
}
</script>
</head>

<body style="margin: 0; padding: 0; overflow: hidden;" onload="runRepaintTest()">
<div style="width: 100%; height: 100%; position: absolute;">
<!-- After window resizing, this DIV element should not be visible -->
<div style="width: 100px; min-height: 33%; background-color: red; display: inline-block;"></div>
</div>
<div id="resize-target" style="width: 400px; height: 400px; position: absolute;">
<!-- After window resizing, this DIV element should not be visible -->
<div style="width: 100px; min-height: 50%; background-color: red; display: inline-block;"></div>
</div>

<div style="width: 100px; height: 100px; background-color: green; position: absolute;"></div>

<script>
function repaintTest() {
window.resizeBy(0, -window.innerHeight / 2);
}
</script>
<div style="width: 100px; height: 100px; background-color: green; position: absolute;"></div>
</body>
</html>
22 changes: 10 additions & 12 deletions LayoutTests/svg/custom/svg-percent-scale-expected.html
@@ -1,20 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<script src="../../fast/repaint/resources/repaint.js"></script>
<script src="../../fast/repaint/resources/repaint.js"></script>
<script>
function repaintTest()
{
document.getElementById('resize-target').style.width = '200px';
document.getElementById('resize-target').style.height = '200px';
}
</script>
</head>

<body style="margin: 0; padding: 0; overflow: hidden;" onload="runRepaintTest()">
<div style="width: 100%; height: 100%; position: absolute;">
<svg width="200" height="150" xmlns="http://www.w3.org/2000/svg">
<rect fill="green" width="100%" height="100%"/>
</svg>
</div>

<script>
function repaintTest() {
window.resizeTo(window.innerWidth / 2, window.innerHeight / 2);
}
</script>
<div id="resize-target" style="width: 400px; height: 400px; position: absolute;"></div>
<div style="width: 100px; height: 100px; position: absolute; background-color: green;"></div>
</body>
</html>
17 changes: 9 additions & 8 deletions LayoutTests/svg/custom/svg-percent-scale-vonly-expected.html
@@ -1,16 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<script src="../../fast/repaint/resources/repaint.js"></script>
<script src="../../fast/repaint/resources/repaint.js"></script>
<script>
function repaintTest()
{
document.getElementById('resize-target').style.height = '200px';
}
</script>
</head>

<body style="margin: 0; padding: 0; overflow: hidden;" onload="runRepaintTest()">
<div style="width: 100px; height: 100px; position: absolute; background-color: green;"></div>

<script>
function repaintTest() {
window.resizeBy(0, -window.innerHeight / 2);
}
</script>
<div id="resize-target" style="width: 400px; height: 400px; position: absolute;"></div>
<div style="width: 100px; height: 100px; position: absolute; background-color: green;"></div>
</body>
</html>
34 changes: 17 additions & 17 deletions LayoutTests/svg/custom/svg-percent-scale-vonly.html
@@ -1,27 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<script src="../../fast/repaint/resources/repaint.js"></script>
<title>Test for https://bugs.webkit.org/show_bug.cgi?id=79490</title>
<script src="../../fast/repaint/resources/repaint.js"></script>
<script>
function repaintTest()
{
document.getElementById('resize-target').style.height = '200px';
}
</script>
</head>

<body style="margin: 0; padding: 0; overflow: hidden;" onload="runRepaintTest()">
<div id="resize-target" style="width: 400px; height: 400px; position: absolute;">
<!-- After vertical window resizing, this SVG element should not be visible -->
<svg width="25%" height="50%" xmlns="http://www.w3.org/2000/svg">
<rect fill="red" width="100%" height="100%"></rect>
</svg>

<div style="width: 100%; height: 100%; position: absolute; align: left;">
<!-- After vertical window resizing, this SVG element should not be visible -->
<svg width="50%" height="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 600">
<rect fill="red" width="200" height="200"></rect>
</svg>
<!-- force an anonymous block creation to exercise the percent-height descendants map -->
<div></div>
</div>

<!-- force an anonymous block creation to exercise the percent-height descendants map -->
<div></div>
</div>

<div style="width: 100px; height: 100px; position: absolute; background-color: green;"></div>

<script>
function repaintTest() {
window.resizeBy(0, -window.innerHeight / 2);
}
</script>
<div style="width: 100px; height: 100px; position: absolute; background-color: green;"></div>
</body>
</html>
35 changes: 16 additions & 19 deletions LayoutTests/svg/custom/svg-percent-scale.html
@@ -1,28 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<script src="../../fast/repaint/resources/repaint.js"></script>
<title>Test for https://bugs.webkit.org/show_bug.cgi?id=79490</title>
<script src="../../fast/repaint/resources/repaint.js"></script>
<script>
function repaintTest()
{
document.getElementById('resize-target').style.width = '200px';
document.getElementById('resize-target').style.height = '200px';
}
</script>
</head>

<body style="margin: 0; padding: 0; overflow: hidden;" onload="runRepaintTest()">
<div id="resize-target" style="width: 400px; height: 400px; position: absolute;">
<!-- After window resizing, this SVG element should not be visible -->
<svg width="50%" height="50%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
<rect fill="red" width="100" height="100"></rect>
</svg>
</div>

<div style="width: 100%; height: 100%; position: absolute;">
<!-- After window resizing, this SVG element should not be visible -->
<svg width="50%" height="50%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 600">
<rect fill="red" width="800" height="600"></rect>
</svg>
</div>

<div style="width: 100%; height: 100%; position: absolute;">
<svg width="200" height="150" xmlns="http://www.w3.org/2000/svg">
<rect fill="green" width="100%" height="100%"/>
</svg>
</div>

<script>
function repaintTest() {
window.resizeTo(window.innerWidth / 2, window.innerHeight / 2);
}
</script>
<div style="width: 100px; height: 100px; position: absolute; background-color: green;"></div>
</body>
</html>

0 comments on commit 1407b2f

Please sign in to comment.