gecko-dev/dom/base
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
..
crashtests Bug 677194 - Add test; r=jst 2012-05-05 11:00:05 +02:00
test Backout of c129811b87ef due to mochi bustage 2012-08-23 12:00:51 -07:00
ConsoleAPI.js Bug 676722 - The output of console.log(object) isn't expandable/inspectable in the Web Console; r=rcampbell 2012-08-03 23:14:01 +03:00
ConsoleAPI.manifest
ConsoleAPIStorage.jsm Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
domerr.msg Bug 743888 - Part 1: Remove SVGException and XPathException. r=jonas 2012-06-13 21:12:37 -04:00
DOMError.cpp 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
DOMError.h Bug 783532 - Remove DOMError::CreateForDOMExceptionCode. r=sicking 2012-08-18 08:25:49 -04:00
DOMRequest.cpp Backout of f98bea38e654 due to mochi bustage 2012-08-23 12:01:27 -07:00
DOMRequest.h backout c030a8af8abd and dd0c287660e9 CLOSED TREE 2012-08-08 14:07:39 -07:00
DOMRequestHelper.jsm Bug 758486 - Settings API: make debug output a bit more useful. r=gwagner 2012-05-25 10:37:45 -07:00
IndexedDBHelper.jsm Bug 726378: Unprefix IndexedDB. r=sicking 2012-06-29 09:48:35 -07:00
Makefile.in Bug 783825 - Fix b2g breakage after bug 553102 - Part 1 : fix mozChromeEvent events and system message manager [r=gal] 2012-08-19 12:00:19 -07:00
Navigator.cpp Bug 779378: B2G Voicemail: Hook up to permissions manager; r=gwagner 2012-08-23 16:31:02 -07:00
Navigator.h Bug 707659 - Part 1: DOM implementation, r=jlebar 2012-08-23 01:30:27 +08:00
nsBarProps.cpp 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
nsBarProps.h 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
nsContentPermissionHelper.cpp Bug 775377 - Modify nsIContentPermissionRequest to use nsIPrincipal instead of nsIURI. r=dougt+cjones 2012-07-30 10:58:26 -04:00
nsContentPermissionHelper.h Bug 775377 - Modify nsIContentPermissionRequest to use nsIPrincipal instead of nsIURI. r=dougt+cjones 2012-07-30 10:58:26 -04:00
nsDOMCID.h Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
nsDOMClassInfo.cpp Bug 783162: Make mapped attributes hold the image alive. r=bz 2012-08-24 10:50:49 -07:00
nsDOMClassInfo.h 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
nsDOMClassInfoClasses.h Bug 783520 - [b2g-bluetooth] follow-up to bug 730992, r=qdot 2012-08-22 18:37:08 +08:00
nsDOMClassInfoID.h 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
nsDOMException.cpp 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
nsDOMException.h 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
nsDOMJSUtils.h 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
nsDOMNavigationTiming.cpp 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
nsDOMNavigationTiming.h 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
nsDOMScriptObjectFactory.cpp 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
nsDOMScriptObjectFactory.h 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
nsDOMScriptObjectHolder.h Bug 777292 part 2 - Change all nsnull to nullptr 2012-07-30 17:20:58 +03:00
nsDOMString.h Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
nsDOMWindowList.cpp 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
nsDOMWindowList.h Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
nsDOMWindowUtils.cpp Merge the landing of bug 579517 to mozilla-inbound 2012-08-22 12:12:15 -04:00
nsDOMWindowUtils.h 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
nsFocusManager.cpp 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
nsFocusManager.h 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
nsGlobalWindow.cpp Bug 750570, part 4 - Switch most native CC classes to use the purple buffer. r=smaug 2012-08-24 09:50:06 -07:00
nsGlobalWindow.h Bug 750570, part 4 - Switch most native CC classes to use the purple buffer. r=smaug 2012-08-24 09:50:06 -07:00
nsGlobalWindowCommands.cpp 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
nsGlobalWindowCommands.h Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
nsHistory.cpp 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
nsHistory.h Bug 777292 part 2 - Change all nsnull to nullptr 2012-07-30 17:20:58 +03:00
nsIDOMClassInfo.h Bug 777292 part 2 - Change all nsnull to nullptr 2012-07-30 17:20:58 +03:00
nsIDOMDOMError.idl Bug 705640 - Implement DOMError as defined in DOM 4, r=mounir. 2012-01-24 02:13:41 -08:00
nsIDOMDOMRequest.idl Backout of f98bea38e654 due to mochi bustage 2012-08-23 12:01:27 -07:00
nsIDOMScriptObjectFactory.h 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
nsIEntropyCollector.idl Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
nsIJSEventListener.h Bug 777292 part 2 - Change all nsnull to nullptr 2012-07-30 17:20:58 +03:00
nsIJSNativeInitializer.h 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
nsIScriptChannel.idl Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
nsIScriptContext.h 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
nsIScriptExternalNameSet.h Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
nsIScriptGlobalObject.h Bug 778681 part 6 - Fix some misuses of bool as nsresult; r=bz 2012-07-27 16:51:50 +03:00
nsIScriptGlobalObjectOwner.h Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
nsIScriptNameSpaceManager.h Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
nsIScriptObjectPrincipal.h Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
nsIScriptRuntime.h 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
nsIScriptTimeoutHandler.h 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
nsJSEnvironment.cpp Bug 625199 - s/JSAutoEnterCompartment/JSAutoCompartment/ and make it infallible (r=bholley) 2012-08-21 18:42:53 -07:00
nsJSEnvironment.h 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
nsJSTimeoutHandler.cpp 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
nsJSUtils.cpp 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
nsJSUtils.h 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
nsLocation.cpp Bug 625199 - s/JSAutoEnterCompartment/JSAutoCompartment/ and make it infallible (r=bholley) 2012-08-21 18:42:53 -07:00
nsLocation.h Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
nsMimeTypeArray.cpp 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
nsMimeTypeArray.h 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
nsPerformance.cpp Bug 765163, add missing #include, r=bustage 2012-07-20 20:40:13 +03:00
nsPerformance.h 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
nsPIDOMWindow.h Back out 670c8a2695b3 (bug 771354), 134557d57e6e 4ad52e488977 (bug 774607), and... 2012-08-23 21:34:27 -07:00
nsPIWindowRoot.h Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
nsPluginArray.cpp 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
nsPluginArray.h 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
nsQueryContentEventResult.cpp 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
nsQueryContentEventResult.h 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
nsScreen.cpp 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
nsScreen.h Bug 764753 - Unlock screen orientation when the document is left without explicitly exiting fullscreen. r=smaug 2012-06-22 10:52:47 +02:00
nsScriptNameSpaceManager.cpp 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
nsScriptNameSpaceManager.h 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
nsStructuredCloneContainer.cpp Bug 625199 - s/JSAutoEnterCompartment/JSAutoCompartment/ and make it infallible (r=bholley) 2012-08-21 18:42:53 -07:00
nsStructuredCloneContainer.h Bug 758992 - Make the classes which use the XPCOM nsISupports implementation macros final, to avoid the warning about deleting using a pointer to a base class with virtual functions and no virtual dtor (dom parts); r=bzbarsky 2012-06-14 22:31:55 -04:00
nsWindowMemoryReporter.cpp 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
nsWindowMemoryReporter.h 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
nsWindowRoot.cpp 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
nsWindowRoot.h Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
nsWrapperCache.h Bug 777292 part 2 - Change all nsnull to nullptr 2012-07-30 17:20:58 +03:00
nsWrapperCacheInlines.h Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
ObjectWrapper.jsm Bug 783825 - Fix b2g breakage after bug 553102 - Part 1 : fix mozChromeEvent events and system message manager [r=gal] 2012-08-19 12:00:19 -07:00
ScreenOrientation.h Bug 745145, part 1: Generalize ScreenOrientation into ScreenConfiguration, and add screen rect and color+pixel depth to it. r=mounir 2012-05-08 14:36:07 -07:00
StructuredCloneTags.h Bug 726593 - Implement FileHandle. r=bent 2012-06-03 18:33:52 +02:00