Bug 532721. Be aware that gradient background rendering depends on the size of the containing frame. r=dbaron

This commit is contained in:
Zack Weinberg 2009-12-16 09:08:59 +13:00
parent 55a25263b0
commit 86ab0ff298
6 changed files with 202 additions and 6 deletions

View File

@ -0,0 +1,42 @@
<!doctype html>
<html><head>
<style>
html {
background-image: -moz-linear-gradient(black, white 20%)
}
body {
font-size: 1em;
padding: 2em;
margin: 50px auto;
width: 14em;
border: 1px solid black;
background-color: white;
}
</style>
</head><body>
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
</body>
</html>

View File

@ -0,0 +1,52 @@
<!doctype html>
<html class="reftest-wait"><head>
<style>
html {
background-image: -moz-linear-gradient(black, white 20%)
}
body {
font-size: 1em;
padding: 2em;
margin: 50px auto;
width: 28em;
border: 1px solid black;
background-color: white;
}
</style>
<script>
window.onload = function() {
setTimeout(function() {
document.body.style.width = "14em";
setTimeout(function() {
document.documentElement.removeAttribute("class");
}, 100);
}, 100);
}
</script>
</head><body>
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
</body>
</html>

View File

@ -0,0 +1,43 @@
<!doctype html>
<html><head>
<style>
html {
background-image: -moz-linear-gradient(black, white 20%);
-moz-background-size: 400px 400px;
}
body {
font-size: 1em;
padding: 2em;
margin: 50px auto;
width: 14em;
border: 1px solid black;
background-color: white;
}
</style>
</head><body>
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
</body>
</html>

View File

@ -0,0 +1,53 @@
<!doctype html>
<html class="reftest-wait"><head>
<style>
html {
background-image: -moz-linear-gradient(black, white 20%);
-moz-background-size: 400px 400px;
}
body {
font-size: 1em;
padding: 2em;
margin: 50px auto;
width: 28em;
border: 1px solid black;
background-color: white;
}
</style>
<script>
window.onload = function() {
setTimeout(function() {
document.body.style.width = "14em";
setTimeout(function() {
document.documentElement.removeAttribute("class");
}, 100);
}, 100);
}
</script>
</head><body>
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
pad pad pad pad pad pad pad pad
</body>
</html>

View File

@ -85,4 +85,5 @@ fails == aja-linear-2d.html aja-linear-2-ref.html # bug 526694
== aja-linear-5a.html aja-linear-5-ref.html
fails-if(MOZ_WIDGET_TOOLKIT=="cocoa") == aja-linear-6a.html aja-linear-6-ref.html # bug 526708
fails == aja-linear-6b.html aja-linear-6-ref.html # bug 522607
== height-dependence-1.html height-dependence-1-ref.html
== height-dependence-2.html height-dependence-2-ref.html

View File

@ -448,12 +448,17 @@ struct nsStyleBackground {
void SetInitialValues();
// True if the rendering of this layer might change when the size of the
// corresponding frame changes (if its position or size is a percentage of
// the frame's dimensions).
// True if the rendering of this layer might change when the size
// of the corresponding frame changes. This is true for any
// non-solid-color background whose position or size depends on
// the frame size (that is, was specified with percentages) and is
// also true for nearly all gradients. We don't currently bother
// trying to identify gradients that don't depend on the frame size.
PRBool RenderingMightDependOnFrameSize() const {
return !mImage.IsEmpty() &&
(mPosition.DependsOnFrameSize() || mSize.DependsOnFrameSize());
return (!mImage.IsEmpty() &&
(mImage.GetType() == eStyleImageType_Gradient ||
mPosition.DependsOnFrameSize() ||
mSize.DependsOnFrameSize()));
}
// An equality operator that compares the images using URL-equality