gecko/dom
Kyle Huey e5eb83ac5a 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
..
activities Bug 792343 - Enable FAIL_ON_WARNINGS in some more of dom/ (first batch); r=mounir 2012-09-20 09:55:36 +02:00
alarm Bug 792036 - Automated fixups. r=mccr8 2012-09-24 14:46:29 +02:00
apps Bug 795136 - 2/2 - Add 'network-events' permission to access network-{upload,download} events. r=sicking 2012-09-30 14:48:40 +01:00
base Bug 760331: Coalesce data for inline style across nodes. r=bz 2012-09-30 09:40:24 -07:00
battery Bug 792343 - Enable FAIL_ON_WARNINGS in some more of dom/ (first batch); r=mounir 2012-09-20 09:55:36 +02:00
bindings Bug 760331: Coalesce data for inline style across nodes. r=bz 2012-09-30 09:40:24 -07:00
bluetooth Bug 795458 - a workaround for this bug and fixed a typo, r=qdot 2012-09-30 10:45:21 +08:00
browser-element Back out 95d3bf1b070b (bug 789392) for mochitest failure on a CLOSED TREE 2012-09-27 21:26:59 -07:00
camera Backout c1fff87fd8e8 (bug 779145) due to build bustage. 2012-09-30 00:02:32 -04:00
contacts Bug 784646 - B2G: Cannot import SIM contacts. r=gwagner 2012-09-28 01:37:39 +08:00
devicestorage Bug 776062: Add support for recording video on gonk. r=cjones,double,ikumar,mikeh sr=sicking 2012-09-28 22:30:52 -07:00
encoding Bug 764234 - Incorporate the imported test into our tree and updated some tests to the latest spec. r=dougt 2012-09-28 11:20:47 +01:00
file Bug 795351: Replace LL_MAXINT, LL_MININT, LL_MAXUINT with stdint versions; r=ehsan 2012-09-28 14:55:23 -05:00
fm Bug 794331 - [Permissions] change fmradio to new permissionManager API. r=cjones 2012-09-26 11:00:33 -07:00
icc Bug 793137 - Part 1: IDL for PLAY_TONE, POLL_INTERVAL and REFRESH. r=philikon. sr=sicking 2012-09-21 17:35:51 +08:00
identity Bug 792036 - Automated fixups. r=mccr8 2012-09-24 14:46:29 +02:00
imptests No bug - Remove some dead code from importTestsuite.py. (NPOTB, DONTBUILD) 2012-09-30 09:53:39 +02:00
indexedDB Bug 795351: Replace LL_MAXINT, LL_MININT, LL_MAXUINT with stdint versions; r=ehsan 2012-09-28 14:55:23 -05:00
interfaces 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
ipc Bug 795061 - AssertAppProcessPermission: Kill any process that doesn't have the specified permission, not just app processes. r=cjones 2012-09-28 10:29:36 -07:00
locales Bug 768029 - Apply CSP Policy to trusted and certified apps. Temporarily using a overly permissive policy for certified apps until Gaia is updated to handle the desired policy. r=sicking Parts by sicking, r=mounir 2012-09-25 16:28:17 -07:00
media Bug 760331: Coalesce data for inline style across nodes. r=bz 2012-09-30 09:40:24 -07:00
messages Bug 792846 - SystemMessageInternal.js fails if one of the message receiver is closed. r=vingtetun 2012-09-26 11:06:25 -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 787420 - Part 2/2: add test case for rolling back on error, r=philikon 2012-09-28 11:45:10 +08:00
payment Bug 776417 - Prevent navigator.mozPay from being fired from apps in the background; r=fabrice 2012-09-21 09:20:05 +02:00
permission Bug 758269 - Install permissions from manifest to Permission Manager r=fabrice 2012-09-28 17:16:29 -05:00
plugins Bug 791906: Replace NSPR integer limit constants with stdint ones; r=ehsan 2012-09-28 01:57:33 -05:00
power Bug 790527 - When rebooting/powering off, go through normal gecko shutdown. r=bsmedberg,sr=cjones 2012-09-26 17:12:33 +08:00
settings Bug 777200 - SettingsChangeNotifier should only notify processes with settings-change listeners. r=fabrice 2012-09-26 14:10:32 -07:00
sms Bug 736706 - Part 5: test cases, r=philikon 2012-09-26 14:56:35 +08:00
src Bug 795134 - Remove localStorage when clear private data API is used. r=bent 2012-09-29 18:31:33 +01:00
system Bug 794903 - Final version: BluetoothScoManager implementation, r=qdot 2012-09-29 17:39:05 +08:00
telephony Bug 791906: Replace NSPR integer limit constants with stdint ones; r=ehsan 2012-09-28 01:57:33 -05:00
tests Bug 795136 - 3/2 - Disabling tests until bug 795711 is fixed. r=me 2012-09-30 16:07:51 +01:00
time Bug 789973 - B2G system time: adjust system clock after receiving NITZ timestamp (part 1). r=jlebar 2012-09-28 14:02:28 +08:00
webidl Bug 793294 - Implement AudioBuffer; r=bzbarsky,smaug 2012-09-25 17:58:50 -04:00
wifi Bug 795162 - Use systemlibs.js for WifiWorker. r=philikon 2012-09-27 16:44:08 -07:00
workers Bug 791906: Replace NSPR integer limit constants with stdint ones; r=ehsan 2012-09-28 01:57:33 -05:00
dom-config.mk Bug 779500 - WebFM, r=jlebar,glandium sr=jonas 2012-09-19 11:23:33 -04:00
Makefile.in Bug 779500 - WebFM, r=jlebar,glandium sr=jonas 2012-09-19 11:23:33 -04:00