Commit Graph

3978 Commits

Author SHA1 Message Date
Matt Woodrow
543dfebcda Bug 795796 - Fix empty transactions. r=cjones 2012-10-01 17:29:02 +13:00
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
Mounir Lamouri
ebe616f9e1 Merge m-i inm-c. 2012-09-30 13:19:15 +01:00
Daniel Holbert
4d32a021d6 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
Daniel Holbert
bd68c21394 Bug 666041 patch 7: implementation of flex container class for CSS3 flexbox. r=dbaron 2012-09-29 23:38:46 -07:00
Daniel Holbert
3544930bb5 Bug 666041 patch 6.5: Add flag to nsHTMLReflowState & ComputeSize for measuring auto height. r=dbaron 2012-09-29 23:38:46 -07:00
Matt Woodrow
04f480d859 Bug 795611 - Call virtual InvalidateFrame from InvalidateFrameSubtree since nsTable*Frame overloads it. r=cjones 2012-09-30 19:20:25 +13:00
Matt Woodrow
61b00ebf38 Bug 795576 - Correctly add the NS_FRAME_UPDATE_LAYER_TREE when invalidating inside a popup. r=cjones 2012-09-30 19:20:24 +13:00
Scott Johnson
e7b108bf5e Bug 795313: Modify order of conditionals in UpdateFontInflationDataWidthFor() for performance enhancements. [r=dbaron] 2012-09-28 14:38:33 -05:00
Isaac Aggrey
997db4d142 Bug 791906: Replace NSPR integer limit constants with stdint ones; r=ehsan 2012-09-28 01:57:33 -05:00
Ed Morley
9d3a09a092 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
Robert O'Callahan
4af0a9996d Bug 539356. Make PruneDisplayListForExtraPage prune print preview properly. r=mattwoodrow
PruneDisplayListForExtraPage wasn't pruning properly in print preview. It
was pruning to the RootReferenceFrame, which is per-page when printing normally,
but is the ancestor of all pages in print preview, so it wasn't doing anything in
print preview.
So, pass in the nsPageFrame we want to prune to. This prevents bogus
entirely-clipped-out display items appearing in the display list for the page.
2012-09-28 23:19:39 +12:00
Matt Woodrow
3fb0e93449 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
Matt Woodrow
28ef42bcbf Bug 781053 - Part 1 - Allow conversion of nsImageBoxFrame to an ImageLayer. r=roc 2012-09-25 08:29:14 +12:00
Matt Woodrow
bc48b0711b Bug 539356 - Avoid some causes of unnecessary painting. r=roc 2012-09-26 11:59:56 +12:00
Matt Woodrow
f0d7341b98 Bug 539356 - Correctly invalidate SVG observers. r=roc 2012-08-29 17:49:16 +12:00
Matt Woodrow
1572061ab5 Bug 539356 - Make the table code use rect invalidation to avoid over invalidation. r=roc 2012-08-29 17:48:45 +12:00
Matt Woodrow
5f32437ca2 Bug 539356 - Add an option for frames to invalid just a rect instead of the frame bounds. r=roc 2012-08-29 17:48:45 +12:00
Robert O'Callahan
0cff39f9ec Bug 770058. InvalidateFrame doesn't need flags, we can just avoid calling ScheduleRepaint if we find any ancestor frame with a descendant that needs invalidation. r=mattwoodrow 2012-08-29 17:48:44 +12:00
Matt Woodrow
2478cd23a6 Bug 769922 - Implement nsDisplayAltFeedback, since it can draw outside of the frame's overflow rect. r=roc 2012-08-29 17:48:44 +12:00
Matt Woodrow
79eed389a6 Bug 539356 - Part 27 - Make nsImageFrame's overflow include the AltFeedback image if it will use one. r=roc 2012-08-29 17:48:44 +12:00
Matt Woodrow
5653bfb78b Bug 539356 - Part 26 - Send invalidations for hidden documents. r=roc 2012-08-29 17:48:44 +12:00
Matt Woodrow
e084d5ff7f Bug 539356 - Part 18 - Mark frames with only invalid children as an optimization to use when invalidating further frames. r=roc 2012-08-29 17:48:43 +12:00
Matt Woodrow
dd03a20c68 Bug 539356 - Part 11 - Reimplement empty transactions. r=roc 2012-08-29 17:48:15 +12:00
Matt Woodrow
58d3d65ab2 Bug 539356 - Part 10 - Test changes required for DLBI. r=roc
* * *
[mq]: test-fixes
2012-08-29 17:48:13 +12:00
Matt Woodrow
5a14809d04 Bug 539356 - Part 9f - Compute the invalid area of the layer tree and pass this to the widget. r=roc 2012-08-29 17:47:18 +12:00
Matt Woodrow
4e75c1edde Bug 539356 - Part 9e - FrameLayerBuilder changes for display list invalidation. r=roc
* * *
imported patch move-by-correctly
2012-08-29 17:47:15 +12:00
Matt Woodrow
958ce7d98d Bug 539356 - Part 9c - Remove old invalidation code. r=bz 2012-08-29 17:39:31 +12:00
Matt Woodrow
f4205ce848 Bug 539356 - Part 9b - Add new frame invalidation API. r=roc 2012-08-29 17:39:01 +12:00
Matt Woodrow
cdbc43ed27 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
Leonard Camacho
30bb58343f Bug 524025 - Remove LL_* constants in nsLineLayout with separate booleans with field widths. r=dbaron 2012-09-27 21:26:40 -04:30
Ed Morley
c863356300 Revert mozilla-inbound to e4dd1fa6d222 for crashes and test failures on a CLOSED TREE 2012-09-27 16:34:46 +01:00
Robert O'Callahan
a63666db64 Bug 539356. Make PruneDisplayListForExtraPage prune print preview properly. r=mattwoodrow
PruneDisplayListForExtraPage wasn't pruning properly in print preview. It
was pruning to the RootReferenceFrame, which is per-page when printing normally,
but is the ancestor of all pages in print preview, so it wasn't doing anything in
print preview.
So, pass in the nsPageFrame we want to prune to. This prevents bogus
entirely-clipped-out display items appearing in the display list for the page.
2012-09-28 01:07:40 +12:00
Matt Woodrow
8b36b9562b 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
Matt Woodrow
297a694be4 Bug 781053 - Part 1 - Allow conversion of nsImageBoxFrame to an ImageLayer. r=roc 2012-09-25 08:29:14 +12:00
Matt Woodrow
696b0ccb7c Bug 539356 - Avoid some causes of unnecessary painting. r=roc 2012-09-26 11:59:56 +12:00
Matt Woodrow
936664c503 Bug 539356 - Correctly invalidate SVG observers. r=roc 2012-08-29 17:49:16 +12:00
Matt Woodrow
e3ab671352 Bug 539356 - Make the table code use rect invalidation to avoid over invalidation. r=roc 2012-08-29 17:48:45 +12:00
Matt Woodrow
7d7084a2d1 Bug 539356 - Add an option for frames to invalid just a rect instead of the frame bounds. r=roc 2012-08-29 17:48:45 +12:00
Robert O'Callahan
797525b693 Bug 770058. InvalidateFrame doesn't need flags, we can just avoid calling ScheduleRepaint if we find any ancestor frame with a descendant that needs invalidation. r=mattwoodrow 2012-08-29 17:48:44 +12:00
Matt Woodrow
68cc123853 Bug 769922 - Implement nsDisplayAltFeedback, since it can draw outside of the frame's overflow rect. r=roc 2012-08-29 17:48:44 +12:00
Matt Woodrow
261f7fa26d Bug 539356 - Part 27 - Make nsImageFrame's overflow include the AltFeedback image if it will use one. r=roc 2012-08-29 17:48:44 +12:00
Matt Woodrow
3a9bc2a0cf Bug 539356 - Part 26 - Send invalidations for hidden documents. r=roc 2012-08-29 17:48:44 +12:00
Matt Woodrow
93948cb5d1 Bug 539356 - Part 18 - Mark frames with only invalid children as an optimization to use when invalidating further frames. r=roc 2012-08-29 17:48:43 +12:00
Matt Woodrow
8acde25c22 Bug 539356 - Part 11 - Reimplement empty transactions. r=roc 2012-08-29 17:48:15 +12:00
Matt Woodrow
0b20201fde Bug 539356 - Part 10 - Test changes required for DLBI. r=roc
* * *
[mq]: test-fixes
2012-08-29 17:48:13 +12:00
Matt Woodrow
c73c0db2f1 Bug 539356 - Part 9 - Implement DLBI. r=roc,bz,jwatt 2012-08-29 17:38:58 +12:00
David Zbarsky
7c095183a8 Bug 790508: bustage fix r=me 2012-09-26 17:55:38 -04:00
David Zbarsky
ec0f2bd59e Bug 790508: Make sure we only create nsDisplayOpacity and nsDisplayTransform for the primary frame when content has async animations r=roc 2012-09-26 17:35:29 -04:00
David Zbarsky
fcefc94882 Fix virtual dtor warning, no bug, blanket r=bz 2012-09-26 14:30:34 -04:00