servo/components/style/gecko
Hiroyuki Ikezoe 2274f392d8
style: Try to allocate possible size for AnimationValueMap before composing.
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

Bug: 1418806
Reviewed-by: birtles
MozReview-Commit-ID: 6tcF9aqXh7a
2018-07-01 00:05:46 +02:00
..
arc_types.rs style: Merge ServoDocumentRule and CSSMozDocumentRule. 2018-06-18 19:15:08 +02:00
conversions.rs style: Change nscolor to StyleComplexColor in nsStyleGradientStop. 2018-06-18 19:15:28 +02:00
data.rs style: Fix tidy. 2018-06-23 20:34:10 +02:00
global_style_data.rs Do not disable thread pool in the parent process. 2018-03-07 09:40:33 +11:00
media_queries.rs style: Error reporting fixes for media queries. 2018-07-01 00:04:48 +02:00
mod.rs Backed out changeset fec394734f83 (bug 17624) for build bustage a=backout CLOSED TREE 2017-07-06 21:58:15 +00:00
non_ts_pseudo_class_list.rs Remove nsCSSPseudoClasses.{h,cpp} and nsCSSPseudoClassList.h. 2018-03-28 09:50:14 +11:00
pseudo_element.rs Run rustfmt on selectors, servo_arc, and style. 2018-04-10 17:35:15 -07:00
pseudo_element_definition.mako.rs style: Unprefix :-moz-selection. 2018-05-19 10:15:17 +02:00
regen_atoms.py style: Remove some uses of unused unsafe. 2017-11-15 13:26:24 +01:00
restyle_damage.rs Run rustfmt on selectors, servo_arc, and style. 2018-04-10 17:35:15 -07:00
rules.rs style: Make tidy happy. 2018-04-28 10:26:08 +02:00
selector_parser.rs Run rustfmt on selectors, servo_arc, and style. 2018-04-10 17:35:15 -07:00
snapshot.rs Run rustfmt on selectors, servo_arc, and style. 2018-04-10 17:35:15 -07:00
snapshot_helpers.rs Run rustfmt on selectors, servo_arc, and style. 2018-04-10 17:35:15 -07:00
traversal.rs Run rustfmt on selectors, servo_arc, and style. 2018-04-10 17:35:15 -07:00
url.rs style: Fix tidy. 2018-06-23 20:34:10 +02:00
values.rs Run rustfmt on selectors, servo_arc, and style. 2018-04-10 17:35:15 -07:00
wrapper.rs style: Try to allocate possible size for AnimationValueMap before composing. 2018-07-01 00:05:46 +02:00