As suggested by dglazkov@ in https://bugs.webkit.org/show_bug.cgi?id=52325, convert speech input fields to the new shadow DOM model and remove all this ghastly stuff with manual repaints and attach/detach.
Merge to Bug 54179. *** This bug has been marked as a duplicate of bug 54179 ***