gecko-dev/layout
Hiroyuki Ikezoe 0b9b61abdd Bug 1418806 - Try to allocate possible size for AnimationValueMap before composing. r=birtles
The EffectSet count does not exactly represent the count what we really need
for AnimationValueMap, but in most cases it matches.  For example;

1) The element has two different keyframes animations

 @keyframes anim1 {
   to { opacity: 0; }
 }
 @keyframes anim2 {
   to { transform: rotate(360deg); }
 }

 In this case the number matches.

2) The element has two animations but both keyframes have the same CSS property

 @keyframes anim1 {
   to { opacity: 0; }
 }
 @keyframes anim2 {
   to { opacity: 0.1; }
 }

 In this case the number doesn't match, moreover it results more memory than we
 ever needed, but this case is presumably less common.

3) The element has an animation having keyframes for two different CSS
   properties.

 @keyframes anim {
   from { opacity: 0; transform: rotate(360deg); }
 }

 In this kind of cases, the number doesn't match.  But even so, this patch
 reduces the opportunities that the AnimationValueMap tries to allocate a new
 memory (i.e. less opportunities on expanding the map).

Note that when the hash map is expanded, we do allocate a new RawTable with the
new size then replace the old one with the new one [1], so I believe this
change will reduce the crash rate to some extent.

[1] https://hg.mozilla.org/mozilla-central/file/15c95df467be/servo/components/hashglobe/src/hash_map.rs#l734

MozReview-Commit-ID: 6tcF9aqXh7a

--HG--
extra : rebase_source : 366989d3a2756f5a5711503a57f42f3b746d93a5
2018-06-26 11:08:24 +09:00
..
base Bug 1449756 - Make DisplayPort suppression PresShell specific and not process global. r=kats 2018-06-25 21:42:25 +00:00
build Bug 1268889 - Implement Clear-Site-Data header - part 1, r=mayhemer 2018-06-20 11:57:49 -04:00
doc Bug 1447483: Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle. r=jwatt on a CLOSED TREE 2018-03-22 20:06:24 +01:00
forms Bug 1468663 part 1: Fill in missing mozilla:: namespaces in layout headers that are referenced by files in layout/generic. r=emilio 2018-06-15 16:14:29 +00:00
generic Bug 1449756 - Make DisplayPort suppression PresShell specific and not process global. r=kats 2018-06-25 21:42:25 +00:00
inspector Bug 1418874 part 3 - Remove CSSLexer and related stuff. r=emilio,tromey,smaug 2018-06-14 18:12:02 -07:00
ipc Bug 1467867 - Ensure we populate the event regions overrides properly. r=botond 2018-06-08 21:16:43 +00:00
mathml Bug 1470163: Move test_disabled to an iframe. r=heycam 2018-06-25 10:55:57 +02:00
media
painting Bug 1469472 - Add crashtest. 2018-06-22 12:20:37 -04:00
printing Bug 1468133: Remove the optimization to lazily load non-SVG styles since it's not relevant anymore. r=heycam 2018-06-22 03:42:46 +02:00
reftests Merge inbound to mozilla-central. a=merge 2018-06-25 22:02:08 +03:00
style Bug 1418806 - Try to allocate possible size for AnimationValueMap before composing. r=birtles 2018-06-26 11:08:24 +09:00
svg Merge inbound to mozilla-central. a=merge 2018-06-25 22:02:08 +03:00
tables Bug 1468582: Remove using namespace statements from layout headers. r=mats 2018-06-14 09:08:20 -07:00
tools Bug 1468677 - [reftest] remove dummy reftest.manifests entry used for global filter, r=ahal 2018-06-13 21:28:26 -07:00
xul Bug 1449756 - Make DisplayPort suppression PresShell specific and not process global. r=kats 2018-06-25 21:42:25 +00:00
moz.build