[FIX] web: remove slow css rule

We do not take CSS seriously enough, but it has an impact on rendering
speed.  The rule removed in this commit slowed down the Qunit JS test
suite by a considerable amount:

With a fresh db with no extra addon installed, community version:

- in chrome, before this commit: 103.2s, with this commit: 54.8s
- in firefox, before this commit: 194.9s, with this commit: 117.7s

This is due to the way rendering is done in web browser.  They start
checking css rules from the right, so the *:nth-last-child(2) rule was
checked for every element in the dom, each time it was added/modified.
Note that the rule just above (*:first-child) had no noticeable impact,
but I still think that the universal css selector should still be
avoided in general.

The fun part is that I did not find the place where this rule was
supposed to be applied.  I assume that it is just a dead rule.  If this
is not the case, we can reintroduce the margin-top with the class mt0,
applied on the specific element.
This commit is contained in:
Géry Debongnie
2017-11-13 11:59:23 +01:00
parent b8fb8ad3f0
commit 75b0393454
-3
View File
@@ -147,9 +147,6 @@
*:first-child {
margin-top: 0;
}
*:nth-last-child(2) {
margin-bottom: 0;
}
}
.o_reward_msg_content {