gecko-dev/dom
Kyle Huey 8443a7a8f1 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
..
activities Bug 784678 - Error when calling postCancel and postSuccess in an activity : followup [r=mrbkap] 2012-08-23 11:56:36 -07:00
alarm Merge the landing of bug 579517 to mozilla-inbound 2012-08-22 12:12:15 -04:00
apps Bug 781379: getNotInstalled should be under mgmt and return apps from all origins; r=felipe 2012-08-20 10:19:56 -07:00
base Bug 783162: Make mapped attributes hold the image alive. r=bz 2012-08-24 10:50:49 -07:00
battery Bug 774032 bonus - Use @DEPTH@ and @relativesrcdir@ in Makefile.in. r=ted 2012-08-04 20:26:44 +02:00
bindings Fix for bug 742195 (Implement the extended attributes for null and undefined handling on strings in Paris bindings). r=bz. 2012-07-12 15:55:30 +02:00
bluetooth Bug 625199 - s/JSAutoEnterCompartment/JSAutoCompartment/ and make it infallible (r=bholley) 2012-08-21 18:42:53 -07:00
browser-element Merge m-c to inbound. 2012-08-23 19:50:46 -04:00
camera Bug 579517 - Part 1: Automated conversion of NSPR numeric types to stdint types in Gecko; r=bsmedberg 2012-08-22 11:56:38 -04:00
contacts Bug 785147 - Contacts API: fix import contacts from SIM card. r=fabrice 2012-08-23 11:48:33 -07:00
devicestorage Bug 579517 - Part 1: Automated conversion of NSPR numeric types to stdint types in Gecko; r=bsmedberg 2012-08-22 11:56:38 -04:00
file Bug 625199 - s/JSAutoEnterCompartment/JSAutoCompartment/ and make it infallible (r=bholley) 2012-08-21 18:42:53 -07:00
identity Bug 773485 - Update identity Makefiles to use MOCHITEST_FILES. r=glandium 2012-08-09 00:07:38 -07:00
imptests Bug 780457 - Adapt importTestsuite.py to changes from bug 774032. r=Ms2ger 2012-08-07 09:30:04 +02:00
indexedDB Backout 4bb90f8c6909 (bug 756645) due to Android opt M3 orange on a CLOSED TREE. 2012-08-23 22:54:15 -04:00
interfaces Bug 784809. Allow null for the repeat argument of canvas createPattern. r=peterv 2012-08-23 12:23:23 -07:00
ipc Merge m-c to inbound. 2012-08-23 19:50:46 -04:00
locales Bug 784071 - Add __exposedProps__ warning back into dom.properties. r=mccr8 2012-08-20 10:27:16 -07:00
media Bug 579517 - Part 1: Automated conversion of NSPR numeric types to stdint types in Gecko; r=bsmedberg 2012-08-22 11:56:38 -04:00
messages Bug 784678 - Error when calling postCancel and postSuccess in an activity : followup [r=mrbkap] 2012-08-23 11:56:36 -07:00
mms Bug 774032 bonus - Use @DEPTH@ and @relativesrcdir@ in Makefile.in. r=ted 2012-08-04 20:26:44 +02:00
network Bug 733573 - Expose a client TCP socket API to web applications [r=honzab,fabrice] 2012-08-21 09:46:27 -07:00
permission Bug 780707 - Contacts API: support prompting. r=dougt 2012-08-09 11:34:57 -07:00
plugins Revert bug 776208 for semi-consistent failures: 2012-08-24 13:08:15 -04:00
power Bug 579517 - Part 1: Automated conversion of NSPR numeric types to stdint types in Gecko; r=bsmedberg 2012-08-22 11:56:38 -04:00
settings Bug 781521 - Fix Settings API. r=gwagner 2012-08-14 20:54:33 -07:00
sms Bug 625199 - s/JSAutoEnterCompartment/JSAutoCompartment/ and make it infallible (r=bholley) 2012-08-21 18:42:53 -07:00
src Bug 750570, part 3 - Remove unused stabilizeForDeletion argument. r=smaug 2012-08-24 09:50:06 -07:00
system Bug 625199 - s/JSAutoEnterCompartment/JSAutoCompartment/ and make it infallible (r=bholley) 2012-08-21 18:42:53 -07:00
telephony Bug 625199 - s/JSAutoEnterCompartment/JSAutoCompartment/ and make it infallible (r=bholley) 2012-08-21 18:42:53 -07:00
tests Bug 785161 - Stop uninstalling all installed apps in WebApps tests. r=jlebar 2012-08-23 11:46:38 -07:00
webidl Bug 784809. Allow null for the repeat argument of canvas createPattern. r=peterv 2012-08-23 12:23:23 -07:00
wifi Bug 777203 - Keep a list of managers that are interested in wifi events and send notifications only to them instead of broadcasting notifications to the world. r=gwagner DONTBUILD 2012-08-22 12:37:11 -07:00
workers Bug 625199 - s/JSAutoEnterCompartment/JSAutoCompartment/ and make it infallible (r=bholley) 2012-08-21 18:42:53 -07:00
dom-config.mk Backout 5439489dc320, 983f76488e59, 7a92558a8dec (Bug 714358) for debug build assertions and leaks 2012-08-07 22:18:27 -07:00
Makefile.in Bug 780707 - Contacts API: support prompting. r=dougt 2012-08-09 11:34:57 -07:00