Verify whether the page contains any <math> element before performing the test and inserting the fallback.