gecko-dev/dom/base
Kyle Huey 43e58e33c8 Bug 760331: Coalesce data for inline style across nodes. r=bz
This patch enables sharing of an nsAttrValue's MiscContainer between nodes for style rules.  MiscContainers of type eCSSStyleRule are now refcounted (with some clever struct packing to ensure that the amount of memory allocated for MiscContainer remains unchanged on 32 and 64 bit).  This infrastructure can be used to share most MiscContainer types in the future if we find advantages to sharing other types than just eCSSStyleRuley.  A cache mapping strings to MiscContainers has been added to nsHTMLCSSStyleSheet.  MiscContainers can be shared between nsAttrValues when one nsAttrValue is SetTo another nsAttrValue or when there is a cache hit in this cache.  This patch also adds the ability to tell a style rule that it belongs to an nsHTMLCSSStyleSheet, with appropriate accessor functions to separate that from the existing case of belonging to an nsCSSStyleSheet.

The primary use case is to reduce memory use for pages that have lots of inline style attributes with the same value.  This can happen easily with large pages that are automatically generated.  An (admittedly pathological) testcase in Bug 686975 sees over 250 MB of memory savings with this change.  Reusing the same MiscContainer for multiple nodes saves the overhead of maintaining separate copies of the string containing the serialized value of the style attribute and of creating separate style rules for each node.  Eliminating duplicate style rules enables further savings in layout through style context sharing.  The testcase sees the amount of memory used by style contexts go from over 250 MB to 10 KB.

Because the cache is based on the text value of the style attribute, it will not handle attributes that have different text values but are parsed into identical style rules.  We also do not attempt to share MiscContainers when the node's base URI differs from the document URI.  The effect of these limitations is expected to be low.
2012-09-30 09:40:24 -07:00
..
crashtests Bug 677194 - Add test; r=jst 2012-05-05 11:00:05 +02:00
test Bug 784549 - lockOrientation() should accept an Array of DOMString's in addition of a DOMString. r=jlebar,khuey 2012-09-11 11:55:08 +01: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 Bug 587734: enable the lazy console API added in bug 568629, and hook it up to the Web Console, r=gavin, a=blocking 2010-11-16 16:34:53 -05:00
ConsoleAPIStorage.jsm Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01: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 Bug 783426 - Async firing for FireSuccess/Error on DOMRequest; r=jonas r=khuey 2012-09-04 13:19:22 -07:00
DOMRequest.h Bug 687332: Part 2 - Move event handlers off of DOM objects and keep track of them solely in the event listener manager. r=smaug,bz 2012-08-30 20:45:16 -07:00
DOMRequestHelper.jsm Bug 776825 - Separate message managers into senders and broadcasters. r=smaug 2012-08-27 11:13:02 -03:00
IndexedDBHelper.jsm Bug 726378: Unprefix IndexedDB. r=sicking 2012-06-29 09:48:35 -07:00
Makefile.in Bug 770778 - Make TCPSocket e10s-friendly. r=bent 2012-09-24 14:53:49 -04:00
Navigator.cpp Bug 792471 - Fix crash in navigator.mozSms when child process doesn't have 'sms' permission. r=mounir 2012-09-25 14:46:41 +01:00
Navigator.h Bug 792471 - Fix crash in navigator.mozSms when child process doesn't have 'sms' permission. r=mounir 2012-09-25 14:46:41 +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 787534 - Remove Portrait and Landscape special ScreenOrientation values. r=jlebar 2012-09-19 17:28:16 +01:00
StructuredCloneTags.h Bug 726593 - Implement FileHandle. r=bent 2012-06-03 18:33:52 +02:00
domerr.msg Bug 764234 - Implement StringEncoding API. r=dougt,smontagu 2012-09-28 11:19:18 +01: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 718293 - Anchor string in nsHTMLDocumentSH::CallToGetPropMapper. r=jorendorff 2012-09-29 12:32:56 -04:00
nsDOMClassInfo.h Bug 787856 - Convert JS_GetPrototype to support lazy protos (r=bhackett) 2012-09-03 16:42:17 -07:00
nsDOMClassInfoClasses.h Bug 744700 - B2G 3G: Notify connection errors in the WebMobileConnection API (part 1), r=bent 2012-09-25 12:21:39 -07: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 764234 - Implement StringEncoding API. r=dougt,smontagu 2012-09-28 11:19:18 +01: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 780161 - Part a: Deduplicate code in nsDOMWindowList; r=peterv 2012-09-06 09:14:49 +02:00
nsDOMWindowList.h Bug 780161 - Part a: Deduplicate code in nsDOMWindowList; r=peterv 2012-09-06 09:14:49 +02:00
nsDOMWindowUtils.cpp bug 674373 pt 5 - provide a fullZoom API in nsIDOMWindowUtils, and use this rather than inferring zoom from CSS to device pixel ratio. r=roc 2012-09-29 12:35:19 +01: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 760331: Coalesce data for inline style across nodes. r=bz 2012-09-30 09:40:24 -07: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 795136 - 2/2 - Add 'network-events' permission to access network-{upload,download} events. r=sicking 2012-09-30 14:48:40 +01:00
nsGlobalWindow.h Bug 795136 - 1/2 - Add events notifying the window if upload/download happen on the system. r=smaug sr=sicking 2012-09-30 14:47:48 +01:00
nsGlobalWindowCommands.cpp Bug 773151: Convert nsCAutoString->nsAutoCString CLOSED TREE r=bsmedberg 2012-09-01 22:35:17 -04:00
nsGlobalWindowCommands.h Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
nsHistory.cpp Bug 773151: Convert nsCAutoString->nsAutoCString CLOSED TREE r=bsmedberg 2012-09-01 22:35:17 -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 790870 - Implement install/update API during installation of hosted apps - Part 2 : hosted apps implementation [r=gwagner] 2012-09-26 18:01:20 -07:00
nsIDOMDOMRequest.idl Bug 783426 - Async firing for FireSuccess/Error on DOMRequest; r=jonas r=khuey 2012-09-04 13:19:22 -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 791906: Replace NSPR integer limit constants with stdint ones; r=ehsan 2012-09-28 01:57:33 -05: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 773151: Convert nsCAutoString->nsAutoCString CLOSED TREE r=bsmedberg 2012-09-01 22:35:17 -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 773151: Convert nsCAutoString->nsAutoCString CLOSED TREE r=bsmedberg 2012-09-01 22:35:17 -04: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
nsPIDOMWindow.h Bug 795136 - 1/2 - Add events notifying the window if upload/download happen on the system. r=smaug sr=sicking 2012-09-30 14:47:48 +01:00
nsPIWindowRoot.h Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
nsPerformance.cpp Bug 787554. Don't prefix WebIDL getters names with a Get if they look like simple member access on the C++ side. r=peterv 2012-09-11 20:08:24 +01:00
nsPerformance.h Bug 787554. Don't prefix WebIDL getters names with a Get if they look like simple member access on the C++ side. r=peterv 2012-09-11 20:08:24 +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 787534 - Remove Portrait and Landscape special ScreenOrientation values. r=jlebar 2012-09-19 17:28:16 +01:00
nsScreen.h Bug 787538 - Make sure the event listener is disconnected if the screen lock is rejected by the backend. r=jlebar 2012-09-11 14:15:43 +01:00
nsScriptNameSpaceManager.cpp Bug 778044. Add a way to pref off Paris binding constructor objects. r=peterv 2012-09-05 13:37:28 -04:00
nsScriptNameSpaceManager.h Bug 778044. Add a way to pref off Paris binding constructor objects. r=peterv 2012-09-05 13:37:28 -04:00
nsStructuredCloneContainer.cpp Back out b24a73b2c617 for Windows build bustage and test_xhr_timeout.html failure 2012-09-27 21:24:42 -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 773151: Convert nsCAutoString->nsAutoCString CLOSED TREE r=bsmedberg 2012-09-01 22:35:17 -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 794694 - Make sure to trace all the gray GCthings, not only wrapper, r=mccr8 2012-09-29 01:29:37 +03:00
nsWrapperCacheInlines.h Bug 794694 - Make sure to trace all the gray GCthings, not only wrapper, r=mccr8 2012-09-29 01:29:37 +03:00