Effects: Respect display value on inline elements

Take "olddisplay" value into the account

Fixes #14824
Closes gh-1566
Ref 73fe17299a840a8a7f3ffffcac15e32a88bd3d66

(cherry-picked from c34dbf5a8d135e0f873ab7a76d1c8f8e316f31e4)
Conflicts:
	src/effects.js