Do you really have to set and reset style.overflow here? That seems like a bug. Just changing the displayed text should be enough. I'd file a gecko bug if it doesn't work without the style.overflow stuff.