Fixes LadybirdBrowser/ladybird#887. (cherry picked from commit 5abe246385dc70e9b69426cd19302d28b7d869d0)