gecko/content/smil
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
..
crashtests Bug 720103 - Add test for create-delete cycles; r=dholbert 2012-05-16 14:30:45 +09:00
test Bug 767931. Make drawWindow and asyncDrawXULElement ChromeOnly. r=roc 2012-09-07 01:29:47 -04:00
Makefile.in Bug 774032 bonus - Use @DEPTH@ and @relativesrcdir@ in Makefile.in. r=ted 2012-08-04 20:26:44 +02:00
nsDOMTimeEvent.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
nsDOMTimeEvent.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
nsISMILAnimationElement.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
nsISMILAttr.h Bug 563659 part 3 - Make Element inherit from FragmentOrElement; r=bz 2012-06-27 16:01:55 +03:00
nsISMILType.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
nsSMILAnimationController.cpp Bug 795351: Replace LL_MAXINT, LL_MININT, LL_MAXUINT with stdint versions; r=ehsan 2012-09-28 14:55:23 -05:00
nsSMILAnimationController.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
nsSMILAnimationFunction.cpp Bug 760331: Coalesce data for inline style across nodes. r=bz 2012-09-30 09:40:24 -07:00
nsSMILAnimationFunction.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
nsSMILCompositor.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
nsSMILCompositor.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
nsSMILCompositorTable.h Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
nsSMILCSSProperty.cpp Bug 777292 part 2 - Change all nsnull to nullptr 2012-07-30 17:20:58 +03:00
nsSMILCSSProperty.h Bug 763350 - Clean up some includes in content/ and dom/ r=smaug 2012-07-01 16:45:59 -07:00
nsSMILCSSValueType.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
nsSMILCSSValueType.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
nsSMILFloatType.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
nsSMILFloatType.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
nsSMILInstanceTime.cpp Bug 791906: Replace NSPR integer limit constants with stdint ones; r=ehsan 2012-09-28 01:57:33 -05:00
nsSMILInstanceTime.h Bug 786503: mark nsSMILInstanceTime::mVisited as mutable. r=birtles 2012-08-28 22:27:53 -07:00
nsSMILInterval.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
nsSMILInterval.h Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
nsSMILKeySpline.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
nsSMILKeySpline.h Bug 755084 Part 2: Perform CSS animations of transform and opacity on the compositor r=roc, dbaron 2012-07-31 10:28:21 -07:00
nsSMILMappedAttribute.cpp Bug 780618 - Move all error codes to nsError.h; r=ehsan 2012-07-27 17:03:27 +03:00
nsSMILMappedAttribute.h Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
nsSMILMilestone.h Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
nsSMILNullType.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
nsSMILNullType.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
nsSMILParserUtils.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
nsSMILParserUtils.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
nsSMILRepeatCount.cpp Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
nsSMILRepeatCount.h Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
nsSMILSetAnimationFunction.cpp Bug 790285 - avoid nullptr -> false conversions. r=ehsan. 2012-09-11 14:00:37 -04:00
nsSMILSetAnimationFunction.h Bug 777292 part 2 - Change all nsnull to nullptr 2012-07-30 17:20:58 +03:00
nsSMILTargetIdentifier.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
nsSMILTimeContainer.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
nsSMILTimeContainer.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
nsSMILTimedElement.cpp Bug 760331: Coalesce data for inline style across nodes. r=bz 2012-09-30 09:40:24 -07:00
nsSMILTimedElement.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
nsSMILTimeValue.cpp Bug 795351: Replace LL_MAXINT, LL_MININT, LL_MAXUINT with stdint versions; r=ehsan 2012-09-28 14:55:23 -05:00
nsSMILTimeValue.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
nsSMILTimeValueSpec.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
nsSMILTimeValueSpec.h Bug 777292 part 2 - Change all nsnull to nullptr 2012-07-30 17:20:58 +03:00
nsSMILTimeValueSpecParams.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
nsSMILTypes.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
nsSMILValue.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
nsSMILValue.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
SMILBoolType.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
SMILBoolType.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
SMILEnumType.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
SMILEnumType.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
SMILIntegerType.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
SMILIntegerType.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
SMILStringType.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
SMILStringType.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