Stream-based shouldDisplay checking

Closes #9895.
Merge pull request #9988 from ef4/fix-inline-if

Stream-based shouldDisplay checking