gecko/layout/reftests/backgrounds
Kyle Huey 0cae034974 Bug 783162: Make mapped attributes hold the image alive. r=bz
The nsCSSValue in nsGenericHTMLElement::MapBackgroundInto is a temporary.  This causes a problem after Bug 697230 landed, because the nsCSSValue::Image we put into that value is destroyed once we're done doing style stuff.  Previously the nsImageLoader would grab the request off the nsCSSValue::Image and hold it alive.  Bug 697230 changed the behavior here; now when the nsCSSValue::Image is destroyed it tells the image loader to drop the request.  The result is that all the references to the request are dropped and the frame is never told it has a background.

The solution is to keep the nsCSSValue::Image alive longer.  This patch adds two new types of nsAttrValue.  The first is an nsCSSValue::URL.  A ParseBackgroundAttribute method is added on nsGenericHTMLElement that the relevant elements (body/td/th/table/tr/tbody/thead/tfoot) call that parses background into an nsCSSValue::URL.  The second is an nsCSSValue::Image.  nsGenericHTMLElement::MapBackgroundInto attempts to convert the nsCSSValue::URL into an nsCSSValue::Image by kicking off the image load.  The result is that image loads are only started when the element is actually visible.  This also mirrors the way background-image works.  This also allows us to fix two longstanding bugs in this code.  Since MapBackgroundInto doesn't have a pointer to the actual element, it relied on grabbing the principal of the document.  Now we can grab the principal of the node in ParseBackgroundAttribute.  MapBackgroundInto also has no way to get at the element's base URI (to honor xml:base), which is now possible in ParseBackgroundAttribute.

nsCSSValue::[Image|URL] have also been moved to be mozilla::css::[Image|URL]Value.  nsAttrValue.h is included in external linkage code, so it can't include nsCSSValue.h to get the declarations of nsCSSValue::[Image|URL], and nested classes can't be forward declared.  Moving the classes to a namespace solves the problem.

Finally some old inoperative quirks mode code was removed.  This code has done nothing since Bug 273078 was landed in 2004.
2012-08-24 10:50:49 -07:00
..
gradient Bug 609714 - Properly compute background image size for vector background images lacking intrinsic sizes or an intrinsic aspect ratio. r=dholbert, r=dbaron 2011-01-13 04:40:12 -06:00
vector Bug 747274 - Add a pref (default to true on Android) to forcible use nearest pixel filtering for background drawing. r=jrmuizel,ajuma a=blassey 2012-04-24 10:28:46 -04:00
aqua-32x32.png
aqua-yellow-32x32.png Bug 548375 - Add tests for background-repeat taking two values (css3-background). r=dbaron 2012-02-24 21:23:14 -08:00
background-clip-1-ref.html Add -moz-background-clip: content. (Bug 549809) r=roc 2010-06-08 18:44:32 -07:00
background-clip-1.html Rename properties and values of background-clip and background-origin to match css3-background. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-clip-2-ref.html Bug 624301. Only change background clip to padding-box for solid borders if it's border-box to start with. r=dbaron 2011-01-14 10:34:39 -05:00
background-clip-2.html Bug 624301. Only change background clip to padding-box for solid borders if it's border-box to start with. r=dbaron 2011-01-14 10:34:39 -05:00
background-moz-default-background-color-ref.html Bug 591341 - Add color keywords for default text and background colors. r=dbaron 2011-03-30 11:28:05 +02:00
background-moz-default-background-color.html Bug 591341 - Add color keywords for default text and background colors. r=dbaron 2011-03-30 11:28:05 +02:00
background-position-1-ref.html Bug 522607 - Tests for new css3-background background-position syntax. r=dbaron 2012-02-20 12:16:11 +13:00
background-position-1a.html Bug 522607 - Tests for new css3-background background-position syntax. r=dbaron 2012-02-20 12:16:11 +13:00
background-position-1b.html Bug 522607 - Tests for new css3-background background-position syntax. r=dbaron 2012-02-20 12:16:11 +13:00
background-position-1c.html Bug 522607 - Tests for new css3-background background-position syntax. r=dbaron 2012-02-20 12:16:11 +13:00
background-position-2-ref.html Bug 522607 - Tests for new css3-background background-position syntax. r=dbaron 2012-02-20 12:16:11 +13:00
background-position-2a.html Bug 522607 - Tests for new css3-background background-position syntax. r=dbaron 2012-02-20 12:16:11 +13:00
background-position-2b.html Bug 522607 - Tests for new css3-background background-position syntax. r=dbaron 2012-02-20 12:16:11 +13:00
background-position-3-ref.html Bug 522607 - Tests for new css3-background background-position syntax. r=dbaron 2012-02-20 12:16:11 +13:00
background-position-3a.html Bug 522607 - Tests for new css3-background background-position syntax. r=dbaron 2012-02-20 12:16:11 +13:00
background-position-3b.html Bug 522607 - Tests for new css3-background background-position syntax. r=dbaron 2012-02-20 12:16:11 +13:00
background-position-4-ref.html Bug 522607 - Tests for new css3-background background-position syntax. r=dbaron 2012-02-20 12:16:11 +13:00
background-position-4a.html Bug 522607 - Tests for new css3-background background-position syntax. r=dbaron 2012-02-20 12:16:11 +13:00
background-position-4b.html Bug 522607 - Tests for new css3-background background-position syntax. r=dbaron 2012-02-20 12:16:11 +13:00
background-position-4c.html Bug 522607 - Tests for new css3-background background-position syntax. r=dbaron 2012-02-20 12:16:11 +13:00
background-position-5-ref.html Bug 522607 - Tests for new css3-background background-position syntax. r=dbaron 2012-02-20 12:16:11 +13:00
background-position-5.html Bug 522607 - Tests for new css3-background background-position syntax. r=dbaron 2012-02-20 12:16:11 +13:00
background-position-6-ref.html Bug 522607 - Tests for new css3-background background-position syntax. r=dbaron 2012-02-20 12:16:11 +13:00
background-position-6.html Bug 522607 - Tests for new css3-background background-position syntax. r=dbaron 2012-02-20 12:16:11 +13:00
background-position-7-ref.html Bug 522607 - Tests for new css3-background background-position syntax. r=dbaron 2012-02-20 12:16:11 +13:00
background-position-7.html Bug 522607 - Tests for new css3-background background-position syntax. r=dbaron 2012-02-20 12:16:11 +13:00
background-position-8-ref.html Bug 522607 - Tests for new css3-background background-position syntax. r=dbaron 2012-02-20 12:16:11 +13:00
background-position-8.html Bug 522607 - Tests for new css3-background background-position syntax. r=dbaron 2012-02-20 12:16:11 +13:00
background-redraw-237766-ref.html Add invalidate reftest for bug 237766. r=dbaron 2009-08-11 10:58:12 -07:00
background-redraw-237766.html Add invalidate reftest for bug 237766. r=dbaron 2009-08-11 10:58:12 -07:00
background-repeat-1-ref.html Bug 548375 - Add tests for background-repeat taking two values (css3-background). r=dbaron 2012-02-24 21:23:14 -08:00
background-repeat-1.html Bug 548375 - Add tests for background-repeat taking two values (css3-background). r=dbaron 2012-02-24 21:23:14 -08:00
background-size-auto-auto.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-auto-length-ref.html Bug 189519 - Implement CSS3 (-moz- for now)background-size. r=dbaron, other useful review comments from roc/bz 2009-05-28 11:09:05 -07:00
background-size-auto-length.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-auto-percent.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-auto-ref.html Bug 189519 - Implement CSS3 (-moz- for now)background-size. r=dbaron, other useful review comments from roc/bz 2009-05-28 11:09:05 -07:00
background-size-auto.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-body-contain-no-repeat.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-body-contain-not-fixed.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-body-contain.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-body-cover-no-repeat.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-body-cover-not-fixed.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-body-cover-ref.html Bug 189519 - Implement CSS3 (-moz- for now)background-size. r=dbaron, other useful review comments from roc/bz 2009-05-28 11:09:05 -07:00
background-size-body-cover.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-body-percent-percent-no-repeat.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-body-percent-percent-not-fixed.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-body-percent-percent-overflow-ref.html Bug 189519 - Implement CSS3 (-moz- for now)background-size. r=dbaron, other useful review comments from roc/bz 2009-05-28 11:09:05 -07:00
background-size-body-percent-percent-overflow.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-body-percent-percent-ref.html Bug 189519 - Implement CSS3 (-moz- for now)background-size. r=dbaron, other useful review comments from roc/bz 2009-05-28 11:09:05 -07:00
background-size-body-percent-percent.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-body-single-not-fixed.html Bug 189519 - Implement CSS3 (-moz- for now)background-size. r=dbaron, other useful review comments from roc/bz 2009-05-28 11:09:05 -07:00
background-size-bounding-box.html Bug 189519 - Implement CSS3 (-moz- for now)background-size. r=dbaron, other useful review comments from roc/bz 2009-05-28 11:09:05 -07:00
background-size-contain-clip-border-ref.html Rename properties and values of background-clip and background-origin to match css3-background. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-contain-clip-border.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-contain-clip-padding-origin-border-padding-ref.html Rename properties and values of background-clip and background-origin to match css3-background. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-contain-clip-padding-origin-border-padding.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-contain-clip-padding-origin-border-ref.html Rename properties and values of background-clip and background-origin to match css3-background. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-contain-clip-padding-origin-border.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-contain-clip-padding-ref.html Rename properties and values of background-clip and background-origin to match css3-background. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-contain-clip-padding.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-contain-position-fifty-fifty-ref.html Bug 189519 - Implement CSS3 (-moz- for now)background-size. r=dbaron, other useful review comments from roc/bz 2009-05-28 11:09:05 -07:00
background-size-contain-position-fifty-fifty.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-contain-ref.html Bug 189519 - Implement CSS3 (-moz- for now)background-size. r=dbaron, other useful review comments from roc/bz 2009-05-28 11:09:05 -07:00
background-size-contain.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-continuous.html Bug 189519 - Implement CSS3 (-moz- for now)background-size. r=dbaron, other useful review comments from roc/bz 2009-05-28 11:09:05 -07:00
background-size-cover-bounding-box.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-cover-continuous.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-cover-each-box.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-cover-ref.html Bug 189519 - Implement CSS3 (-moz- for now)background-size. r=dbaron, other useful review comments from roc/bz 2009-05-28 11:09:05 -07:00
background-size-cover.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-each-box.html Bug 189519 - Implement CSS3 (-moz- for now)background-size. r=dbaron, other useful review comments from roc/bz 2009-05-28 11:09:05 -07:00
background-size-length-auto.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-length-length-ref.html Bug 189519 - Implement CSS3 (-moz- for now)background-size. r=dbaron, other useful review comments from roc/bz 2009-05-28 11:09:05 -07:00
background-size-length-length.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-length-percent-ref.html Bug 189519 - Implement CSS3 (-moz- for now)background-size. r=dbaron, other useful review comments from roc/bz 2009-05-28 11:09:05 -07:00
background-size-length-percent.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-length.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-monster-ch.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-monster-cm.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-monster-em.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-monster-ex.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-monster-inches.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-monster-mm.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-monster-pc.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-monster-pt.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-monster-px.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-monster-ref.html Bug 508325 - "ABORT: negative scaling factors must be handled manually". r=roc 2009-08-05 15:34:27 -07:00
background-size-monster-rem.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-percent-auto.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-percent-length.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-percent-percent-ref.html Bug 189519 - Implement CSS3 (-moz- for now)background-size. r=dbaron, other useful review comments from roc/bz 2009-05-28 11:09:05 -07:00
background-size-percent-percent-stretch-ref.html Bug 189519 - Implement CSS3 (-moz- for now)background-size. r=dbaron, other useful review comments from roc/bz 2009-05-28 11:09:05 -07:00
background-size-percent-percent-stretch.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-percent-percent.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-percent.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-zoom-no-repeat-ref.html Bug 189519 - Implement CSS3 (-moz- for now)background-size. r=dbaron, other useful review comments from roc/bz 2009-05-28 11:09:05 -07:00
background-size-zoom-no-repeat.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
background-size-zoom-repeat-ref.html Bug 189519 - Implement CSS3 (-moz- for now)background-size. r=dbaron, other useful review comments from roc/bz 2009-05-28 11:09:05 -07:00
background-size-zoom-repeat.html Rename -moz-background-size to background-size. (Bug 549809) r=roc 2010-06-08 18:44:33 -07:00
blue-8x20-green-8x20.png
blue-8x20-green-16x20.png
blue-8x20.png
blue-16x20-green-8x20.png
blue-16x20-green-16x20.png
blue-16x20.png
blue-32x32.png
body-background-ref.html Bug 783162: Make mapped attributes hold the image alive. r=bz 2012-08-24 10:50:49 -07:00
body-background.html Bug 783162: Make mapped attributes hold the image alive. r=bz 2012-08-24 10:50:49 -07:00
continuous-inline-1-ref.html
continuous-inline-1a.html
continuous-inline-1b.html
continuous-inline-1c.html
continuous-inline-1d.html
continuous-inline-2-ref.html
continuous-inline-2a.html
continuous-inline-2b.html
continuous-inline-3-ref.html
continuous-inline-3.html
continuous-inline-4-ref.html
continuous-inline-4a.html
continuous-inline-4b.html
continuous-inline-5-ref.html
continuous-inline-5a.html
continuous-inline-5b.html
delay-image-response.sjs Bug 128502 - Move imagelib to mozilla/image on a CLOSED TREE. r=joe,brendan 2011-10-17 21:32:45 -07:00
div-background-ref.html Bug 783162: Make mapped attributes hold the image alive. r=bz 2012-08-24 10:50:49 -07:00
div-background.html Bug 783162: Make mapped attributes hold the image alive. r=bz 2012-08-24 10:50:49 -07:00
fixed-bg-with-transform-outside-viewport-1.html Bug 622818. Don't clip fixed backgrounds to the viewport if we are inside a transform. r=roc a=blocking 2011-02-08 13:29:28 -06:00
fixed-bg-with-transform-outside-viewport-ref.html Bug 622818. Don't clip fixed backgrounds to the viewport if we are inside a transform. r=roc a=blocking 2011-02-08 13:29:28 -06:00
fuchsia-32x32.png
green-8x20-blue-8x20-vertical.png Bug 189519 - Implement CSS3 (-moz- for now)background-size. r=dbaron, other useful review comments from roc/bz 2009-05-28 11:09:05 -07:00
green-8x20.png
green-16x20.png
iframe-translucent-color-1.html
iframe-translucent-color-ref.html
layers-layer-count-1-ref.xhtml
layers-layer-count-2-ref.xhtml
layers-layer-count-cascade-1.xhtml
layers-layer-count-cascade-2.xhtml
layers-layer-count-inheritance-1.xhtml
layers-layer-count-inheritance-2.xhtml
layers-stacking-order-ref.xhtml
layers-stacking-order.xhtml
malformed.png
really-big-background-ref.html Bug 697230: Part 3 - Make style images block onload. r=bz 2012-08-13 16:04:17 -07:00
really-big-background.html Bug 697230: Part 3 - Make style images block onload. r=bz 2012-08-13 16:04:17 -07:00
really-big-background.png Bug 697230: Part 3 - Make style images block onload. r=bz 2012-08-13 16:04:17 -07:00
red-32x32.png
red-128-alpha-32x32.png
reftest.list Bug 783162: Make mapped attributes hold the image alive. r=bz 2012-08-24 10:50:49 -07:00
root-background-1.html Bug 631682. Make sure to start background image loads for the root element when we compute its style and decide to construct a frame. r+a=dbaron 2011-02-04 22:43:13 -05:00
root-background-ref.html Bug 631682. Make sure to start background image loads for the root element when we compute its style and decide to construct a frame. r+a=dbaron 2011-02-04 22:43:13 -05:00
root-element-display-none-1.html
root-element-display-none-ref.html
table-background-ref.html Bug 783162: Make mapped attributes hold the image alive. r=bz 2012-08-24 10:50:49 -07:00
table-background.html Bug 783162: Make mapped attributes hold the image alive. r=bz 2012-08-24 10:50:49 -07:00
translucent-color-1.html
translucent-color-2.html
translucent-color-3.html
translucent-color-ref.html
transparent-32x32.png
viewport-translucent-color-1.html
viewport-translucent-color-2.html
viewport-translucent-color-3.html
viewport-translucent-color-ref.html
yellow-32x32.png