gecko/layout/generic
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 539356 - Part 10 - Test changes required for DLBI. r=roc 2012-08-29 17:48:13 +12:00
test Bug 752786 - Disable one part of test_bug469613.xul on OS X 10.8 for too many intermittent failures 2012-09-28 15:45:29 +01:00
broken-image.png
folder.png
frame-graph.py
frame-verify.js
FrameChildList.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
FrameChildList.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
jar.mn
loading-image.png
Makefile.in Bug 596753: Flatten layout/svg/base/src into layout/svg. r=dholbert 2012-09-24 23:01:21 +02:00
nsAbsoluteContainingBlock.cpp Bug 539356 - Part 9c - Remove old invalidation code. r=bz 2012-08-29 17:39:31 +12:00
nsAbsoluteContainingBlock.h
nsAutoCopyListener.h
nsBlockDebugFlags.h
nsBlockFrame.cpp Bug 760331: Coalesce data for inline style across nodes. r=bz 2012-09-30 09:40:24 -07:00
nsBlockFrame.h Bug 539356 - Part 9c - Remove old invalidation code. r=bz 2012-08-29 17:39:31 +12:00
nsBlockReflowContext.cpp Bug 780387 - Part b: Stop using PRIntn; r=bsmedberg 2012-08-09 09:09:40 +02:00
nsBlockReflowContext.h
nsBlockReflowState.cpp Bug 539356 - Part 9c - Remove old invalidation code. r=bz 2012-08-29 17:39:31 +12:00
nsBlockReflowState.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
nsBRFrame.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
nsBulletFrame.cpp Bug 760331: Coalesce data for inline style across nodes. r=bz 2012-09-30 09:40:24 -07:00
nsBulletFrame.h Bug 733186: Annotate ~1000 methods with MOZ_OVERRIDE in /layout r=dholbert r=dbaron 2012-09-14 09:10:08 -07:00
nsCanvasFrame.cpp Bug 539356 - Part 9c - Remove old invalidation code. r=bz 2012-08-29 17:39:31 +12:00
nsCanvasFrame.h Bug 539356 - Part 9a - Add new display list invalidation API to nsDisplayItem and implement it. r=roc 2012-08-29 17:39:01 +12:00
nsColumnSetFrame.cpp Bug 791906: Replace NSPR integer limit constants with stdint ones; r=ehsan 2012-09-28 01:57:33 -05:00
nsContainerFrame.cpp Bug 539356 - Part 9c - Remove old invalidation code. r=bz 2012-08-29 17:39:31 +12:00
nsContainerFrame.h Bug 788202 - Add optional subdocument traversal to nsIFrame::List. r=bz 2012-09-19 15:36:35 +01:00
nsFirstLetterFrame.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
nsFirstLetterFrame.h Bug 733186: Annotate ~1000 methods with MOZ_OVERRIDE in /layout r=dholbert r=dbaron 2012-09-14 09:10:08 -07:00
nsFlexContainerFrame.cpp Bug 666041 patch 7: implementation of flex container class for CSS3 flexbox. r=dbaron 2012-09-29 23:38:46 -07:00
nsFlexContainerFrame.h Bug 666041 patch 7: implementation of flex container class for CSS3 flexbox. r=dbaron 2012-09-29 23:38:46 -07:00
nsFloatManager.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
nsFloatManager.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
nsFontInflationData.cpp Bug 795313: Modify order of conditionals in UpdateFontInflationDataWidthFor() for performance enhancements. [r=dbaron] 2012-09-28 14:38:33 -05:00
nsFontInflationData.h
nsFrame.cpp Merge m-i inm-c. 2012-09-30 13:19:15 +01:00
nsFrame.h Bug 539356 - Part 9c - Remove old invalidation code. r=bz 2012-08-29 17:39:31 +12:00
nsFrameIdList.h Bug 666041 patch 7: implementation of flex container class for CSS3 flexbox. r=dbaron 2012-09-29 23:38:46 -07:00
nsFrameList.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
nsFrameList.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
nsFrameSelection.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
nsFrameSetFrame.cpp Bug 760331: Coalesce data for inline style across nodes. r=bz 2012-09-30 09:40:24 -07:00
nsFrameSetFrame.h Bug 733186: Annotate ~1000 methods with MOZ_OVERRIDE in /layout r=dholbert r=dbaron 2012-09-14 09:10:08 -07:00
nsFrameUtil.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
nsGfxScrollFrame.cpp Bug 539356 - Part 9c - Remove old invalidation code. r=bz 2012-08-29 17:39:31 +12:00
nsGfxScrollFrame.h Bug 539356 - Part 9c - Remove old invalidation code. r=bz 2012-08-29 17:39:31 +12:00
nsHTMLCanvasFrame.cpp Bug 539356 - Part 9e - FrameLayerBuilder changes for display list invalidation. r=roc 2012-08-29 17:47:15 +12:00
nsHTMLCanvasFrame.h Bug 788044 - Make inactive layer subtrees relative to the ContainerLayer, not the reference frame. r=roc 2012-09-17 10:25:33 +12:00
nsHTMLParts.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
nsHTMLReflowMetrics.cpp
nsHTMLReflowMetrics.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
nsHTMLReflowState.cpp Bug 666041 patch 8: Add special handling for "min-width: auto" value on flex items. r=dbaron 2012-09-29 23:38:46 -07:00
nsHTMLReflowState.h Bug 666041 patch 6.5: Add flag to nsHTMLReflowState & ComputeSize for measuring auto height. r=dbaron 2012-09-29 23:38:46 -07:00
nsIAnonymousContentCreator.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
nsIFrame.h Bug 666041 patch 6.5: Add flag to nsHTMLReflowState & ComputeSize for measuring auto height. r=dbaron 2012-09-29 23:38:46 -07:00
nsIFrameUtil.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
nsILineIterator.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
nsImageFrame.cpp Bug 781053 - Part 2 - Trigger empty transactions when an animated image in an ImageLayer changes frame. r=roc 2012-09-25 08:31:30 +12:00
nsImageFrame.h Bug 781053 - Part 1 - Allow conversion of nsImageBoxFrame to an ImageLayer. r=roc 2012-09-25 08:29:14 +12:00
nsImageMap.cpp Bug 539356 - Part 9c - Remove old invalidation code. r=bz 2012-08-29 17:39:31 +12:00
nsImageMap.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
nsInlineFrame.cpp Bug 765409 - Make sure we reparent all child frames on our principal list (when lazily setting the parent), and no other frames. r=bz 2012-09-08 02:33:58 +02:00
nsInlineFrame.h Bug 733186: Annotate ~1000 methods with MOZ_OVERRIDE in /layout r=dholbert r=dbaron 2012-09-14 09:10:08 -07:00
nsIntervalSet.cpp
nsIntervalSet.h
nsIObjectFrame.h
nsIPageSequenceFrame.h Bug 745025 - Part 2 - Adds layout/printing support for mozPrintCallback. r=roc 2012-08-30 17:24:35 -07:00
nsIScrollableFrame.h Back out bug 791616 due to test failure. 2012-09-24 21:55:16 +12:00
nsIStatefulFrame.h
nsLeafFrame.cpp
nsLeafFrame.h Bug 733186: Annotate ~1000 methods with MOZ_OVERRIDE in /layout r=dholbert r=dbaron 2012-09-14 09:10:08 -07:00
nsLineBox.cpp Bug 788202 - Add optional subdocument traversal to nsIFrame::List. r=bz 2012-09-19 15:36:35 +01:00
nsLineBox.h Bug 791906: Replace NSPR integer limit constants with stdint ones; r=ehsan 2012-09-28 01:57:33 -05:00
nsLineLayout.cpp Bug 791906: Replace NSPR integer limit constants with stdint ones; r=ehsan 2012-09-28 01:57:33 -05:00
nsLineLayout.h Bug 791906: Replace NSPR integer limit constants with stdint ones; r=ehsan 2012-09-28 01:57:33 -05:00
nsObjectFrame.cpp Bug 791906: Replace NSPR integer limit constants with stdint ones; r=ehsan 2012-09-28 01:57:33 -05:00
nsObjectFrame.h Bug 788044 - Make inactive layer subtrees relative to the ContainerLayer, not the reference frame. r=roc 2012-09-17 10:25:33 +12:00
nsPageContentFrame.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
nsPageContentFrame.h Bug 733186: Annotate ~1000 methods with MOZ_OVERRIDE in /layout r=dholbert r=dbaron 2012-09-14 09:10:08 -07:00
nsPageFrame.cpp Bug 539356. Make PruneDisplayListForExtraPage prune print preview properly. r=mattwoodrow 2012-09-28 23:19:39 +12:00
nsPageFrame.h Bug 792314 - Build full display lists for nsPageFrame. r=roc 2012-09-20 11:26:33 +12:00
nsPlaceholderFrame.cpp Bug 539356 - Part 9c - Remove old invalidation code. r=bz 2012-08-29 17:39:31 +12:00
nsPlaceholderFrame.h Bug 788202 - Add optional subdocument traversal to nsIFrame::List. r=bz 2012-09-19 15:36:35 +01:00
nsPluginUtilsOSX.h
nsPluginUtilsOSX.mm
nsQueryFrame.h
nsSelection.cpp Bug 791616. Part 3: Don't scroll vertically to get the caret into view if that's not a perceived scrollable direction. r=mats 2012-09-24 16:38:16 +12:00
nsSimplePageSequence.cpp Bug 539356 - Part 9c - Remove old invalidation code. r=bz 2012-08-29 17:39:31 +12:00
nsSimplePageSequence.h Bug 539356 - Part 9c - Remove old invalidation code. r=bz 2012-08-29 17:39:31 +12:00
nsSplittableFrame.cpp Bug 785321 - Replace PRUptrdiff with uintptr_t, prtdiff_t or etc; r=ehsan,jrmuizel 2012-09-14 16:09:52 -04:00
nsSplittableFrame.h Bug 733186: Annotate ~1000 methods with MOZ_OVERRIDE in /layout r=dholbert r=dbaron 2012-09-14 09:10:08 -07:00
nsSubDocumentFrame.cpp Bug 760331: Coalesce data for inline style across nodes. r=bz 2012-09-30 09:40:24 -07:00
nsSubDocumentFrame.h Bug 788202 - Add optional subdocument traversal to nsIFrame::List. r=bz 2012-09-19 15:36:35 +01:00
nsTextFrame.h Bug 791906: Replace NSPR integer limit constants with stdint ones; r=ehsan 2012-09-28 01:57:33 -05:00
nsTextFrameTextRunCache.h
nsTextFrameThebes.cpp Bug 791906: Replace NSPR integer limit constants with stdint ones; r=ehsan 2012-09-28 01:57:33 -05:00
nsTextFrameUtils.cpp Bug 655877 - Part 23a: Add white-space:-moz-pre-discard-newlines value with white space collapsing behavior like SVG's xml:space="preserve". r=roc,dbaron 2012-09-07 15:42:19 +10:00
nsTextFrameUtils.h Bug 655877 - Part 23a: Add white-space:-moz-pre-discard-newlines value with white space collapsing behavior like SVG's xml:space="preserve". r=roc,dbaron 2012-09-07 15:42:19 +10:00
nsTextRunTransformations.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
nsTextRunTransformations.h Bug 733186: Annotate ~1000 methods with MOZ_OVERRIDE in /layout r=dholbert r=dbaron 2012-09-14 09:10:08 -07:00
nsVideoFrame.cpp Bug 539356 - Part 9e - FrameLayerBuilder changes for display list invalidation. r=roc 2012-08-29 17:47:15 +12:00
nsVideoFrame.h Bug 788044 - Make inactive layer subtrees relative to the ContainerLayer, not the reference frame. r=roc 2012-09-17 10:25:33 +12:00
nsViewportFrame.cpp Bug 539356 - Part 9c - Remove old invalidation code. r=bz 2012-08-29 17:39:31 +12:00
nsViewportFrame.h Bug 539356 - Part 9c - Remove old invalidation code. r=bz 2012-08-29 17:39:31 +12:00
ScrollbarActivity.cpp Bug 626472 part 3 - Remove nsnull for good; r=ehsan 2012-08-12 13:43:47 +03:00
ScrollbarActivity.h Bug 778810 - Show/Hide scrollbars depending on activity. r=roc 2012-08-03 12:35:14 +02:00
Selection.h Bug 766181 - Require Selection::AddItem's aOutIndex param. r=roc 2012-09-17 14:54:01 +01:00
TextOverflow.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
TextOverflow.h