So the issue here is that with a single window and single tab open on a theme change we get 8 each of "notify::gtk-theme-name" and "notify::gtk-key-theme-name" all dispatched to 8 different widgets. This leads to 32 calls into nsPresContext::ThemeChanged, since nsWindow::ThemeChanged calls ThemeChanged on all child windows too. In practice, this means X calls to ClearStyleDataAndReflow on the chrome prescontext, X calls to ResizeReflow on the content prescontext, and 32-X calls to ClearStyleDataAndReflow on the content prescontext. I didn't bother to find out what X is. The upshot is that in my case I had 100+ documents open at the time of the theme change; reflowing each of them 30+ times just ... took a while.
Patch coming up that should make this saner. Certainly does over here.
So the issue here is that with a single window and single tab open on a theme change we get 8 each of "notify: :gtk-theme- name" and "notify: :gtk-key- theme-name" all dispatched to 8 different widgets. This leads to 32 calls into nsPresContext: :ThemeChanged, since nsWindow: :ThemeChanged calls ThemeChanged on all child windows too. In practice, this means X calls to ClearStyleDataA ndReflow on the chrome prescontext, X calls to ResizeReflow on the content prescontext, and 32-X calls to ClearStyleDataA ndReflow on the content prescontext. I didn't bother to find out what X is. The upshot is that in my case I had 100+ documents open at the time of the theme change; reflowing each of them 30+ times just ... took a while.
Patch coming up that should make this saner. Certainly does over here.