Effects: Respect display value on inline elements

Take "olddisplay" value into the account

Fixes #14824
Ref 73fe17299a840a8a7f3ffffcac15e32a88bd3d66