gecko/layout/forms
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 716875 - Make nsTextControlFrame inherits from nsContainerFrame instead of nsStackFrame. r=roc,bz 2012-06-23 13:11:00 +02:00
test Bug 792036 - Automated fixups. r=mccr8 2012-09-24 14:46:29 +02:00
Makefile.in Bug 774032 bonus - Use @DEPTH@ and @relativesrcdir@ in Makefile.in. r=ted 2012-08-04 20:26:44 +02:00
nsButtonFrameRenderer.cpp Bug 770106. nsDisplayButtonBorderBackground should use the button's border-box for hit-testing, not its visual overflow area. r=mattwoodrow 2012-09-28 23:19:38 +12:00
nsButtonFrameRenderer.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
nsComboboxControlFrame.cpp Bug 539356 - Part 9c - Remove old invalidation code. r=bz 2012-08-29 17:39:31 +12:00
nsComboboxControlFrame.h Bug 733186: Annotate ~1000 methods with MOZ_OVERRIDE in /layout r=dholbert r=dbaron 2012-09-14 09:10:08 -07:00
nsFieldSetFrame.cpp Bug 539356 - Part 9c - Remove old invalidation code. r=bz 2012-08-29 17:39:31 +12:00
nsFileControlFrame.cpp Fix for bug 788532 (Add the new DOM bindings API to DOM lists). r=bz. 2012-09-05 22:49:53 +02:00
nsFileControlFrame.h Bug 733186: Annotate ~1000 methods with MOZ_OVERRIDE in /layout r=dholbert r=dbaron 2012-09-14 09:10:08 -07:00
nsFormControlFrame.cpp Bug 788491 - Remove kSizeNotSet constants; r=roc 2012-09-17 10:37:20 +02:00
nsFormControlFrame.h Bug 733186: Annotate ~1000 methods with MOZ_OVERRIDE in /layout r=dholbert r=dbaron 2012-09-14 09:10:08 -07:00
nsGfxButtonControlFrame.cpp Fix for bug 788532 (Add the new DOM bindings API to DOM lists). r=bz. 2012-09-05 22:49:53 +02:00
nsGfxButtonControlFrame.h Bug 733186: Annotate ~1000 methods with MOZ_OVERRIDE in /layout r=dholbert r=dbaron 2012-09-14 09:10:08 -07:00
nsGfxCheckboxControlFrame.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
nsGfxCheckboxControlFrame.h Bug 733186: Annotate ~1000 methods with MOZ_OVERRIDE in /layout r=dholbert r=dbaron 2012-09-14 09:10:08 -07:00
nsGfxRadioControlFrame.cpp Bug 777292 part 2 - Change all nsnull to nullptr 2012-07-30 17:20:58 +03:00
nsGfxRadioControlFrame.h Bug 733186: Annotate ~1000 methods with MOZ_OVERRIDE in /layout r=dholbert r=dbaron 2012-09-14 09:10:08 -07:00
nsHTMLButtonControlFrame.cpp Bug 785754. Fix handling of max-height for frame classes that still seem to think that the mComputedMinHeight/mComputedMaxHeight of a reflow state are border-box heights, not content-box heights. r=mats 2012-08-27 15:46:23 -04:00
nsHTMLButtonControlFrame.h Bug 733186: Annotate ~1000 methods with MOZ_OVERRIDE in /layout r=dholbert r=dbaron 2012-09-14 09:10:08 -07:00
nsICapturePicker.idl Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
nsIComboboxControlFrame.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
nsIFormControlFrame.h Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
nsIListControlFrame.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
nsImageControlFrame.cpp Bug 777292 part 2 - Change all nsnull to nullptr 2012-07-30 17:20:58 +03:00
nsISelectControlFrame.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
nsITextControlFrame.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
nsLegendFrame.cpp Bug 760331: Coalesce data for inline style across nodes. r=bz 2012-09-30 09:40:24 -07:00
nsLegendFrame.h Bug 733186: Annotate ~1000 methods with MOZ_OVERRIDE in /layout r=dholbert r=dbaron 2012-09-14 09:10:08 -07:00
nsListControlFrame.cpp Bug 539356 - Part 9c - Remove old invalidation code. r=bz 2012-08-29 17:39:31 +12:00
nsListControlFrame.h Bug 539356 - Part 9c - Remove old invalidation code. r=bz 2012-08-29 17:39:31 +12:00
nsMeterFrame.cpp Bug 539356 - Part 9c - Remove old invalidation code. r=bz 2012-08-29 17:39:31 +12:00
nsMeterFrame.h Bug 733186: Annotate ~1000 methods with MOZ_OVERRIDE in /layout r=dholbert r=dbaron 2012-09-14 09:10:08 -07:00
nsProgressFrame.cpp Bug 539356 - Part 9c - Remove old invalidation code. r=bz 2012-08-29 17:39:31 +12:00
nsProgressFrame.h Bug 733186: Annotate ~1000 methods with MOZ_OVERRIDE in /layout r=dholbert r=dbaron 2012-09-14 09:10:08 -07:00
nsSelectsAreaFrame.cpp Bug 788044 - Make transformed frames the reference frame for their display list tree. r=roc 2012-09-16 22:32:59 +12:00
nsSelectsAreaFrame.h Bug 733186: Annotate ~1000 methods with MOZ_OVERRIDE in /layout r=dholbert r=dbaron 2012-09-14 09:10:08 -07:00
nsTextControlFrame.cpp Bug 760331: Coalesce data for inline style across nodes. r=bz 2012-09-30 09:40:24 -07:00
nsTextControlFrame.h Bug 733186: Annotate ~1000 methods with MOZ_OVERRIDE in /layout r=dholbert r=dbaron 2012-09-14 09:10:08 -07:00